Page 1 of 1

Compairing Strings, part II

Posted: Sat Apr 24, 2004 1:03 pm
by Micro
The announcement lists "== != < > <= >= && ||" as compairison operators.

What is notably missing is Contains, the old ~~

if (${String["This long sentance"]} ~~ "long") /echo true

Posted: Sat Apr 24, 2004 1:07 pm
by Preocts
Umm.. you missed the part that says those are not for string comparisions
Lax wrote: string
- Members:
...int Find[text]: Looks for the given text, gives position (currently NULL if not found)
...int Length: The length of the string
...string Upper: The string in all UPPER CASE
...string Lower: The string in all lower case
...string Left[length]: The left (length) of the string.. Left[2] of "Left" will be "Le"
...string Right[length]: The right (length) of the string.. Right[2] of "Left" will be "ft"
...string Mid[position,length]: The left (length) starting at (position).. Mid[2,2] of "Left" will be "ef"
...int Compare[text]: -1 if the string is alphabetically before text, 0 if equal, 1 if after. Case does not count.
...int CompareCS[text]: -1 if the string is alphabetically before text, 0 if equal, 1 if after. Case counts.
...bool Equal[text]: Strings equal? Case does not count...
...bool NotEqual[text]: Strings not equal? Case does not count...
...bool EqualCS[text]: Strings equal? Case counts!
...bool NotEqualCS[text]: Strings not equal? Case counts!
...string Arg[n,separator]: Gets nth argument using separator as the separator (single character). If separator is not given, defaults to space
- To String: ... this IS a string, assface

Posted: Sat Apr 24, 2004 1:11 pm
by Micro
Gawd, no wonder i didnt find it, I mispelled Compare!

Posted: Sat Apr 24, 2004 1:17 pm
by Micro
Add to that, its also Find[blah]

I only repeat this for my fellow scripters.

Posted: Sat Apr 24, 2004 1:50 pm
by Preocts
Wow. If you saw that just image what would happen if everyone went to this fucking thread and actually read about TLO.

http://macroquest2.com/phpBB2/viewtopic.php?t=6022