Unicode Intrinsic Functions - ContainsOnly Method

Test to see if the strings contains only the specified characters

Member of Unicode Intrinsic Functions (PRIM_LIBI.IUnicodeIntrinsics)


Name Type Data Type Description
Result *Result (Optional) Boolean True if the string only contains the characters specified
String *Input Unicode String Characters to be compared against


ContainsOnly compares the contents of the subject string against the characters supplied in the String parameter and returns a True if no other characters are found in the subject.


In the sample below, the string is tested to ensure that it only contains the digits 0 through 9 and a blank.  If other characters are used in #String, the function returns False.
#Save.Enabled := #String.ContainsOnly( " 0123456789" )

See also

All Component Classes

Technical Reference

LANSA Version 15, April 2020