Skip to content

A LiveCode function to return the offsets of a character in a string. Uses items. Is much faster than the built-in offset function with chars-to-skip.

Notifications You must be signed in to change notification settings

bwmilby/alloffsets

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

AllOffsets is a LiveCode function that returns a comma-delimited list of all the offsets of a character in a string. It does this by setting the item delimiter and parsing the items of the string, instead of using the more obvious offset function with the characters-to-skip parameter. As a result it is about 30% faster for simple strings (strings without multi-byte characters) and substantially to extremely (hundreds of times) faster for strings that include multibyte characters -- in testing on a 50,000-character string, it was 300x faster.

About

A LiveCode function to return the offsets of a character in a string. Uses items. Is much faster than the built-in offset function with chars-to-skip.

Resources

Stars

Watchers

Forks

Packages

No packages published