IsOneOf (String function): Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
m (1 revision) |
||
Line 1: | Line 1: | ||
{{Template:String:IsOneOf subtitle}} | {{Template:String:IsOneOf subtitle}} | ||
This [[Intrinsic classes|intrinsic]] function returns a Boolean value that indicates whether the method object | This [[Intrinsic classes|intrinsic]] function returns a Boolean value that indicates whether the method object | ||
string is matched by one of the strings in an input list of strings. | string is matched by one of the strings in an input list of strings. | ||
The input list of strings is concatenated in a single delimited longstring argument to the method. | The input list of strings is concatenated in a single delimited longstring argument to the method. | ||
A returned value of ''''True'''' signals a successful match. | A returned value of ''''True'''' signals a successful match. | ||
The IsOneOf function is available as of version 7.3 of the [[Sirius Mods]]. | The IsOneOf function is available as of version 7.3 of the [[Sirius Mods]]. | ||
==Syntax== | ==Syntax== | ||
{{Template:String:IsOneOf syntax}} | {{Template:String:IsOneOf syntax}} | ||
Line 18: | Line 18: | ||
<td>A longstring that contains a delimited set of potential matching strings for the method object string. The strings in ''stringSet'' are separated by a separator character, which must be indicated by the first character of the argument. The separator must be non-alphanumeric. The format of ''stringSet'' is therefore ''separatorString1[separatorString2]...''.</td></tr> | <td>A longstring that contains a delimited set of potential matching strings for the method object string. The strings in ''stringSet'' are separated by a separator character, which must be indicated by the first character of the argument. The separator must be non-alphanumeric. The format of ''stringSet'' is therefore ''separatorString1[separatorString2]...''.</td></tr> | ||
</table> | </table> | ||
==Usage notes== | ==Usage notes== | ||
*The ''stringSet'' argument must be non-null or the request is cancelled. | *The ''stringSet'' argument must be non-null or the request is cancelled. | ||
==Examples== | ==Examples== | ||
The following are IsOneOf sample statements: | The following are IsOneOf sample statements: | ||
%str is longstring | %str is longstring | ||
%str = 'bleh' | %str = 'bleh' | ||
[[Intrinsic classes#printtext|printText]] {~} = '{%str:isOneOf('/blah/bleh/blih')}' | [[Intrinsic classes#printtext|printText]] {~} = '{%str:isOneOf('/blah/bleh/blih')}' | ||
printText {~} = '{%str:isOneOf(',blah,bleh,blih')}' | printText {~} = '{%str:isOneOf(',blah,bleh,blih')}' | ||
printText {~} = '{%str:isOneOf('/blah/blh/blih')}' | printText {~} = '{%str:isOneOf('/blah/blh/blih')}' | ||
The results are respectively: | The results are respectively: | ||
%str:isOneOf('/blah/bleh/blih') = True | %str:isOneOf('/blah/bleh/blih') = True | ||
%str:isOneOf(',blah,bleh,blih') = True | %str:isOneOf(',blah,bleh,blih') = True | ||
%str:isOneOf('/blah/blh/blih') = False | %str:isOneOf('/blah/blh/blih') = False | ||
===See also=== | ===See also=== | ||
[[List of intrinsic String methods]] | [[List of intrinsic String methods]] | ||
[[Category:Intrinsic String methods|IsOneOf function]] | [[Category:Intrinsic String methods|IsOneOf function]] | ||
[[Category:Intrinsic methods]] | [[Category:Intrinsic methods]] |
Revision as of 14:04, 19 January 2011
Is the method object string matched by any of the strings in the input list? (String class)
This intrinsic function returns a Boolean value that indicates whether the method object
string is matched by one of the strings in an input list of strings.
The input list of strings is concatenated in a single delimited longstring argument to the method.
A returned value of 'True' signals a successful match.
The IsOneOf function is available as of version 7.3 of the Sirius Mods.
Syntax
%boolean = string:IsOneOf( list)
Syntax terms
%bool | An enumeration object of type Boolean to contain the returned value of IsOneOf. |
---|---|
string | The string to which the method is applied, the maximum length of which is 255 bytes. |
stringSet | A longstring that contains a delimited set of potential matching strings for the method object string. The strings in stringSet are separated by a separator character, which must be indicated by the first character of the argument. The separator must be non-alphanumeric. The format of stringSet is therefore separatorString1[separatorString2].... |
Usage notes
- The stringSet argument must be non-null or the request is cancelled.
Examples
The following are IsOneOf sample statements:
%str is longstring %str = 'bleh' printText {~} = '{%str:isOneOf('/blah/bleh/blih')}' printText {~} = '{%str:isOneOf(',blah,bleh,blih')}' printText {~} = '{%str:isOneOf('/blah/blh/blih')}'
The results are respectively:
%str:isOneOf('/blah/bleh/blih') = True %str:isOneOf(',blah,bleh,blih') = True %str:isOneOf('/blah/blh/blih') = False