I want to compare two Strings:
is String One lower then String Two?
String strOne;
String strTwo;
strOne = "alpha";
strTwo = "beta";
if(strOne < strTwo){
return true;
}
i need it, because i need to sort a collection!
it's urgent, thanks
I want to compare two Strings:
is String One lower then String Two?
String strOne;
String strTwo;
strOne = "alpha";
strTwo = "beta";
if(strOne < strTwo){
return true;
}
i need it, because i need to sort a collection!
it's urgent, thanks
you can't do a mathematical comaprison on 2 strings, you will have to find some way of converting them to the charater code, one symbol at a time.
but in Standardway the Object String has the Methd Compare(StringA,StringB) and returns an integer value:
StringA < StringB = -1;
StringA = StringB = 0;
StringA > StringB = 1;
i just want this option or function at my script..i tried to recreate it, but didn't fix it until now...please help me
it would also be cool, to have an Array where i can do this:
StringArray test;
String StringA;
String StringB;
StringA = "Alpha";
StringB = "Beta";
test.Add("beatakey",SringB);
test.Add("alphakey",SringA);
test.sortByKey();
int count;
int i;
count = test.size();
for(i=0;i<count;i++){
String Key;
Key = test.Key(i);
String value;
value=test.get(Key);
}
this would be sooo nice!
back to the top of the list!
You must log in to post.