Compatible Unicode Intrinsic Functions - OccurrencesIn Method

Find the number times the string occurs in a variable

Member of Compatible Unicode Intrinsic Functions (PRIM_LIBI.ICompatibleUnicodeIntrinsics)


NameTypeData TypeDescription
Result*Result (Optional)IntegerResulting number
String*InputUnicode StringString to be searched
StartPosition*Input (Optional)IntegerPosition at which to start searching


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


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

See also

All Component Classes

Technical Reference

LANSA Version 15, April 2020