Core Function CSetMatch
From Sputnik Wiki
(Difference between revisions)
UberFoX (Talk | contribs)
(Created page with "<pre> CSetMatch( <expression>, <charset>, <case> ) </pre> === Description === Check if a string contains only characters from a substring(charset). === Parameters === ==== ex...")
Newer edit →
(Created page with "<pre> CSetMatch( <expression>, <charset>, <case> ) </pre> === Description === Check if a string contains only characters from a substring(charset). === Parameters === ==== ex...")
Newer edit →
Revision as of 18:41, 5 August 2014
CSetMatch( <expression>, <charset>, <case> )
Contents |
Description
Check if a string contains only characters from a substring(charset).
Parameters
expression
The string to check.
charset
A string of chars to compare.
case
Optional; If this param exists the match will be case insensitive regardless of what you place in this param.
Default is case sensitive.
Return Value
Success: Returns 1.
Failure: Returns 0.
Remarks
None.
Example
$cset = 'A'..'F' . 'a'..'f' . '0'..'9'; $str = "411C88"; MsgBox( CSetMatch($str, $cset) ); MsgBox( CSetMatch($str, $cset, 1) ); // Case insensitive
Examples of using this with character set macro
// Check if the string your standard ASCII $str = "The quick brown fox"; MsgBox( CSetMatch("First: " . $str, @Printable) ); // Check if the string is Japanese Hiragana $str = "こんにちわ"; MsgBox( CSetMatch("Second: " . $str, @Hiragana) );
Go here for a complete list of character set macros.