Converting Pascal case to sentences using regular expression
April 30, 2009
Here's another reminder to myself: a nifty one-liner regex which transforms Pascal/camel case string into a sentence. I always write it from scratch so I decided to put it here. It might also be a good idea to write it as an extension method for string class.
static string PascalCaseToSentence(string input)
return Regex.Replace(input, ".[A-Z]",
m => m.ToString() + " " +
will result in: