Darwin Help

Back to Index

SearchDelim

Function SearchDelim - break up a string at each occurrence of a delimiter

Calling Sequence  SearchDelim(delim,txt)
Parameters
NameTypeDescription

delim stringa pattern that delimits portions of a string
txt stringthe text to be split
Return Type  list(string)
Synopsis SearchDelim returns a list of strings, where each string in the list is one of the parts of the txt delimited by occurrences of delim. SearchDelim is ideal to break up a string which contains many lines separated by newlines. If the string after the last occurrence of delim is empty, it is not added to the list. Delimiting with an empty string does not make sense and it is not allowed.
Examples
> SearchDelim('a', 'abracadabra');
[, br, c, d, br]
> SearchDelim('\n', 'file1\nfile2\nfile3\n');
[file1, file2, file3]
See also ApproxSearchString,   BestSearchString,   CaseSearchString,   HammingSearchString,   SearchMultipleString