The Verify function locates the position where a character within a string does not correspond with those defined in the 2nd argument. Two types of searches are supported.
When performing a Match search the Verify function locates the first character that matches those defined in the 2nd argument.
When performing a NoMatch search the Verify function locates the first character that does not match those defined in the 2nd argument.
Note: the character case is significant during the matching process.
result = Verify( string, charSet [, [ option ] [, start ] ] ) |
NoMatch -- locates where the string does not match a reference character (Default)
Match -- locates where the string matches a reference character
Examples:
say Verify( 'Shazam', 'abcsh' ) -- shows: 1, the character case of the 'S' does not match say Verify( 'Shazam', 'abcSh' ) -- shows: 4 say Verify( 'Shazam', 'abcsh', 'N' ) -- shows: 1, the character case of the 'S' does not match say Verify( 'Shazam', 'abcSh', 'N' ) -- shows: 4 say Verify( 'Shazam', 'abc', 'M' ) -- shows: 3, locates the first 'a' say Verify( 'Shazam', 'abc', 'M', 4 ) -- shows: 5 say Verify( 'Shazam', 'def', 'M' ) -- shows: 0, none of the reference characters were located say Verify( '123.45', '0123456789' ) -- shows: 4, the decimal point is not a digit say Verify( '123.45', '0123456789.' ) -- shows: 0, the decimal point is matched now say Verify( '123.45.678', '0123456789.' ) -- shows: 0, both decimal points are matched now |