Unicode Intrinsic Functions - OccurrencesOf Method

Find the number of times the variable occurs in the string

Member of Unicode Intrinsic Functions (PRIM_LIBI.IUnicodeIntrinsics)


NameTypeData TypeDescription
Result*Result (Optional)IntegerNumber of occurrences
String*InputUnicode StringString to search for
StartPosition*Input (Optional)IntegerPosition at which to start searching


OccurrencesOf returns the number of times the string supplied in the String parameter can be found in a string, starting from the character specified in the Startposition parameter.
OccurrencesOf is case sensitive.


In this example, if #String contained "ABCDEABCDEABCDE", the result would be 3
#Occurrences := #String.OccurrencesOf( "ABC" )

See also

All Component Classes

Technical Reference

LANSA Version 15, April 2020