Equinox Online Help - Language Reference - A to Z

Home

ChrList

Applies to
SyntaxChrlist(StringExpression, CharlistExpression [, LogExpression])
Action[Function] Searches through a string, for one of a list of characters.
ScopeUsable anywhere.
Notes

This function checks each character in StringExpression in turn, until one of the characters in CharlistExpression is found, or until the end of StringExpression is reached. The function returns the number of non-matching characters skipped over.

The optional parameter LogExpression defaults to True. If it is supplied as False, then the logic of the search is reversed; StringExpression is searched until a character is found that does not match any in the list.

CategoryString handling
See Also Chrs, Compare, Fill, IsNumber, Left_Function, Len, Match, Maxlen, Mid_Function, Remove, Replace, Right_Function], Search_SearchNext, SetLen, SetMaxLen, SortOrder, SubstituteData
Example

This method breaks up the string txt into words, delimited by characters in the string notword. It displays each word and any immediately following characters, on a separate line in the Print window.

string txt, notword
number wordlen, afterlen

notword = " .-"

txt = "See the red-brown fox. It jumped over the lazy cow"

While Len(txt)
wordlen = Chrlist(txt, notword)| Find End of the Next word
afterlen = Chrlist(Mid(txt, wordlen + 1), notword, False)
Print Left(txt, wordlen), "ends with :"; \
Mid(txt, wordlen + 1, afterlen);":"

| Remove the word and any following characters in notword
Left(txt, wordlen + afterlen) = ""
end while