Last active
December 15, 2015 20:19
-
-
Save kimsama/5317752 to your computer and use it in GitHub Desktop.
A simple camel case string maker by using regexp. It may useful for making Unity3D's custom inspector gui with properties for ui constrol's name. (copied from http://www.example8.com/node/view/id/34476)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Text; | |
using System.Text.RegularExpressions; | |
public static string SplitCamelCase(string inputCamelCaseString) | |
{ | |
string sTemp = Regex.Replace(inputCamelCaseString, "([A-Z][a-z])", " $1", RegexOptions.Compiled).Trim(); | |
return Regex.Replace(sTemp, "([A-Z][A-Z])", " $1", RegexOptions.Compiled).Trim(); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment