Utility library for cool kids
Slowly and steady I'm updating doc here...
Small shortcuts for predefined culture info. And of course good ol' invariant/current ones.
Sushi2.Cultures.Czech
Sushi2.Cultures.English
Sushi2.Cultures.Invariant
Sushi2.Cultures.Current
Enum helper methods.
public enum Robot
{
[Description("First")]
One = 1,
[Description("Second")]
Two = 2,
Three = 3
}
EnumTools.GetEnumFieldDescription(Robot.One);
First
EnumTools.Parse<Robot>("1");
EnumTools.Parse<Robot>("One");
EnumTools.Parse<Robot>(Robot.One);
EnumTools.Parse<Robot>(1);
EnumTools.Parse<Robot>("foo", Robot.One); // this one fails, def value is returned
Robot.One
Robot.One
Robot.One
Robot.One
Robot.One
Returns trimmed string and never null.
" foo ".ToDbString()
foo
Returns trimmed, lower-cased string without diacritics chars. Oh yeah and never null value.
" Žluťoučký kůň ".ToNormalizedString()
zlutoucky kun
Returns normalized string usable for sorting operations for Czech language. Usable in cases when you cannot use a culture specific algorithm (DocumentDB etc.).
"Žluťoučký kůň".ToSortedString()
zbluau*ouad*kz* kuco*
Returns string with space replaced with a non-breaking space string.
"Dr. Ferda mravenec má telefonní číslo 600 111 333.".ToCzechNonBreakingSpacesString("~");
Dr.~Ferda mravenec má telefonní číslo 600~111~333.
Based on various tools, helpers, ... I've been building since .NET beta packed in library called Sushi. I've removed some legacy code, refactored existing one and voila here we go with a fresh new smile for .NET Standard.