[stringalgo] Tokenizer with string delimiters?

Hi, please could anybody tell if it's possible to use split() to tokenize a string where the token delimiters are strings of - n characters, e.g. "\r\n" - m..n characters, e.g. "\n" _or_ "\r\n" If not, are there alternatives? Thanks, Stefan

Hi, Stefan On Tue, Jan 18, 2005 at 04:43:59PM +0100, Stefan Slapeta wrote:
Hi,
please could anybody tell if it's possible to use split() to tokenize a string where the token delimiters are strings of
- n characters, e.g. "\r\n" - m..n characters, e.g. "\n" _or_ "\r\n"
If not, are there alternatives?
It is possible and quite easy with string_algo. Instead of split() try to use split_iterator and as a finder use first_finder(). You may even try to use regex_finder. You can find some more information in the docs. HTH, Pavol
participants (2)
-
Pavol Droba
-
Stefan Slapeta