Suppose I had a string:
string str = \"1111222233334444\";
How can I break this string into chunks of some size?
e.g., breaking t
Using regular expressions and Linq:
List groups = (from Match m in Regex.Matches(str, @"\d{4}") select m.Value).ToList();
I find this to be more readable, but it's just a personal opinion. It can also be a one-liner : ).