C# Class YamlDotNet.Serialization.Utilities.StringExtensions

Various string extension methods
Exibir arquivo Open project: aaubry/YamlDotNet

Public Methods

Method Description
FromCamelCase ( this str, string separator ) : string

Convert the string from camelcase (thisIsATest) to a hyphenated (this-is-a-test) or underscored (this_is_a_test) string

ToCamelCase ( this str ) : string

Convert the string with underscores (this_is_a_test) or hyphens (this-is-a-test) to camel case (thisIsATest). Camel case is the same as Pascal case, except the first letter is lowercase.

ToPascalCase ( this str ) : string

Convert the string with underscores (this_is_a_test) or hyphens (this-is-a-test) to pascal case (ThisIsATest). Pascal case is the same as camel case, except the first letter is uppercase.

Private Methods

Method Description
ToCamelOrPascalCase ( string str, char>.Func firstLetterTransform ) : string

Method Details

FromCamelCase() public static method

Convert the string from camelcase (thisIsATest) to a hyphenated (this-is-a-test) or underscored (this_is_a_test) string
public static FromCamelCase ( this str, string separator ) : string
str this String to convert
separator string Separator to use between segments
return string

ToCamelCase() public static method

Convert the string with underscores (this_is_a_test) or hyphens (this-is-a-test) to camel case (thisIsATest). Camel case is the same as Pascal case, except the first letter is lowercase.
public static ToCamelCase ( this str ) : string
str this String to convert
return string

ToPascalCase() public static method

Convert the string with underscores (this_is_a_test) or hyphens (this-is-a-test) to pascal case (ThisIsATest). Pascal case is the same as camel case, except the first letter is uppercase.
public static ToPascalCase ( this str ) : string
str this String to convert
return string