One-liner for splitting Pascal Casing …

Today I had to write a method for splitting Pascal Cased property names to readable text strings. Because I found a small and stylish solution, I want to show you.

string outputString = System.Text.RegularExpressions.Regex.Replace(
inputString, "([a-z])([A-Z])", "$1 $2", System.Text.RegularExpressions.RegexOptions.Compiled);

Hope you like it
– Gerhard

kick it on

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

Join 108 other followers

%d bloggers like this: