Name
ValidateStr -- validate string (V7.0)
Synopsis
ok, n = ValidateStr(s$[, encoding])
Function
Validates the string specified by s$ and returns True if the string contains only valid characters, False otherwise. The second return value contains the number of valid characters in the string. If validation succeeds, this will be the same as the result of StrLen(). Otherwise this will tell you the offset of the first invalid character in the string.

The optional encoding parameter can be used to set the character encoding to use. This defaults to the default string encoding set using SetDefaultEncoding(). See Character encodings for details.

This function is only useful in case #ENCODING_UTF8 is used. If the encoding is set to #ENCODING_ISO8859_1, this function will always return True.

Inputs
s$
input string
encoding
optional: character encoding to use (defaults to default string encoding)
Results
ok
boolean value indicating success or failure
n
number of valid characters in the string (V7.1)

Show TOC