[2] |
|
|||
Returns | True / false | |||
str | Any Director value | |||
Description | Checks if str is actually the object strX | |||
Examples |
s=_s("abc")
r=s.ref put s=r -- 1 put s.is(r) -- 0 |
|||
Notes |
[3] |
|
|||
Returns | -1, 0, 1 | |||
str | Any Director value | |||
Description |
Compares the string representation of strX and str.
sCmp performs a case sensitive comparison. iCmp a case insensitive comparison. -1: strX is lower (alphabetically) than value 0: no differences 1: strX is higher (alphabetically) than value |
|||
Examples |
put _s("a").iCmp("A")
-- 0 put _s("a").sCmp("A") -- 1 put _s("b").sCmp("c") -- -1 put _s("b").sCmp("a") -- 1 put _s("ab").sCmp("a") -- 1 |
|||
Notes | Case sensitive comparisons are significantly faster than case insensitive ones. (reminder tip: s for speed). |
[4] |
|
|||
Returns | True / False | |||
str | Any Director value | |||
Description |
Check if strX begins with str.
sBgns: case sensitive. iBgns: case insensitive. |
|||
Examples |
put _s("ab").sBgns("a")
-- 1 put _s("ab").sBgns("A") -- 0 put _s("abcd").sBgns( _d("ab") ) --type conversions will be performed as required. -- 1 |
|||
Notes |
[5] |
|
|||
Returns | True / False | |||
str | Any Director value | |||
Description |
Check if strX ends with str.
sEnds: case sensitive. iEnds: case insensitive. |
|||
Examples |
put _s("abc").sEnds("c")
-- 1 put _s("abc").sEnds("Bc") -- 0 put _s("abc").iEnds("Bc") -- 1 |
|||
Notes |
[6] |
|
|||
Returns | True / False | |||
str | Any Director value | |||
Description |
Check if strX includes str.
sIncs: case sensitive. iIncs: case insensitive. |
|||
Examples |
put _s("abc").sIncs("c")
-- 1 put _s("abc").sIncs("Bc") -- 0 |
|||
Notes |
[7] |
|
|||
Returns | Integer | |||
str | Any Director value | |||
Description |
Returns the total appearances of str in strX
sAprs: case sensitive. iAprs: case insensitive. |
|||
Examples |
put _s("abcd-ABCD").sAprs("ab")
-- 1 put _s("abcd-ABCD").iAprs("ab") -- 2 |
|||
Notes |