[Solved] C#. split identificator on the words [closed]


No need for a regexp: you just need to scan the string once and LINQ your way through the task.

yourString.Select(c => string.Format(Char.IsUpper(c) ? " {0}" : "{0}", c));

This will hand you a IEnumerable<string> object containing all the data you need, which can become what you need like this:

string[] output = string.Split(" ", string.Join("", yourString.Select(c => string.Format(Char.IsUpper(c) ? " {0}" : "{0}", c)));

Basically, flow goes like this:

  • Insert any space needed
  • Pack up data
  • Split the tokens

solved C#. split identificator on the words [closed]