Aqueduct.Extensions.Inflector.AddUnderscores C# (CSharp) Method

AddUnderscores() public static method

Adds the underscores.
public static AddUnderscores ( this pascalCasedWord ) : string
pascalCasedWord this The pascal cased word.
return string
        public static string AddUnderscores(this string pascalCasedWord)
        {
            return
                Regex.Replace(
                    Regex.Replace(Regex.Replace(pascalCasedWord, @"([A-Z]+)([A-Z][a-z])", "$1_$2"), @"([a-z\d])([A-Z])",
                        "$1_$2"), @"[-\s]", "_").ToLower();
        }