C# How do I split a string by strings and include the delimiters?

Posted by mafutrct on Stack Overflow See other posts from Stack Overflow or by mafutrct
Published on 2010-03-20T21:50:49Z Indexed on 2010/03/20 22:11 UTC
Read the original article Hit count: 157

Filed under:
|

There are many similar questions, but apparently no perfect match, that's why I'm asking.

I'd like to split a random string (e.g. 123xx456yy789) by a list of string delimiters (e.g. xx, yy) and include the delimiters in the result (here: 123, xx, 456, yy, 789).

Good performance is a nice bonus. Regex should be avoided, if possible.

© Stack Overflow or respective owner

Related posts about c#

Related posts about string-split