C# Class Underscore.Utility.StringComponent

Inheritance: IStringComponent
显示文件 Open project: konkked/Underscore.cs

Public Methods

Method Description
Capitalize ( string s ) : string
IsCamelCase ( string s ) : bool
IsCapitalized ( string s ) : bool
IsKebabCase ( string s ) : bool
IsPascalCase ( string s ) : bool
IsSnakeCase ( string s ) : bool
ToCamelCase ( string s ) : string
ToKebabCase ( string s ) : string
ToPascalCase ( string s ) : string
ToSnakeCase ( string s ) : string
Words ( string s ) : IEnumerable

Private Methods

Method Description
CamelToSnake ( string s ) : string
ContainsLetters ( string s ) : bool
FilterForLetters ( string s ) : string
IsLetter ( char c ) : bool
IsLower ( char c ) : bool
IsUpper ( char c ) : bool
KebabToSnake ( string s ) : string
Normalize ( string s ) : string

normalize a string to snake_case, that way we only need to write one conversion for every other casing snake case was chosen because snake and kebab case are the easiest to convert out of

OtherToSnake ( string s ) : string
PascalToSnake ( string s ) : string

Method Details

Capitalize() public method

public Capitalize ( string s ) : string
s string
return string

IsCamelCase() public method

public IsCamelCase ( string s ) : bool
s string
return bool

IsCapitalized() public method

public IsCapitalized ( string s ) : bool
s string
return bool

IsKebabCase() public method

public IsKebabCase ( string s ) : bool
s string
return bool

IsPascalCase() public method

public IsPascalCase ( string s ) : bool
s string
return bool

IsSnakeCase() public method

public IsSnakeCase ( string s ) : bool
s string
return bool

ToCamelCase() public method

public ToCamelCase ( string s ) : string
s string
return string

ToKebabCase() public method

public ToKebabCase ( string s ) : string
s string
return string

ToPascalCase() public method

public ToPascalCase ( string s ) : string
s string
return string

ToSnakeCase() public method

public ToSnakeCase ( string s ) : string
s string
return string

Words() public method

public Words ( string s ) : IEnumerable
s string
return IEnumerable