Split String in C# without delimiter (sort of)
Posted
by Zach
on Stack Overflow
See other posts from Stack Overflow
or by Zach
Published on 2009-09-28T03:14:42Z
Indexed on
2010/06/05
10:42 UTC
Read the original article
Hit count: 256
Hi, I want to split a string in C#.NET that looks like this:
string Letters = "hello";
and put each letter (h, e, l, l, o
) into an array or ArrayList. I have no idea what to use as the delimiter in String.Split(delimiter)
. I can do it if the original string has commas (or anything else):
string Letters = "H,e,l,l,o";
string[] AllLettersArray = Letters.Split(",".ToCharArray());
But I have no idea what to use in a case with (supposedly) no delimiter. Is there a special character like Environment.Newline
? Thanks.
© Stack Overflow or respective owner