A library to make common string functions easier, such as trimming, wrapping, pluralizing, and much more.
$ dotnet add package Rhyous.StringLibraryA library to make common string functions easier, such as trimming, wrapping, pluralizing, and much more.
It will save you time. Yes, you can write your own string extension methods, but you also have to write unit tests for them. This library is fully unit tested so you can include it and move on.
You get:
String Capitalization extension methods - https://github.com/rhyous/StringLibrary/blob/master/src/Rhyous.StringLibrary.Shared/Capitalization/StringCapitalizationExtensions.cs You can capitalize things easily.
String Comparison extension methods - https://github.com/rhyous/StringLibrary/blob/master/src/Rhyous.StringLibrary.Shared/Comparison/StringComparisonExtensions.cs This has the contains with the ability to ignore case, that is just missing form .Net.
String Conversion extension methods To Primitives https://github.com/rhyous/StringLibrary/blob/master/src/Rhyous.StringLibrary.Shared/Convers ion/PrimitiveStringExtensions.cs Easily convert strings to and from primitives, with the option for a default value if the string conversion fails.
To Stream https://github.com/rhyous/StringLibrary/blob/master/src/Rhyous.StringLibrary.Shared/Conversion/StreamStringExtensions.cs Easily convert to and from a Stream.
To enum https://github.com/rhyous/StringLibrary/blob/master/src/Rhyous.StringLibrary.Shared/Enum/StringEnumExtensions.cs Easily convert to and from an enum.
AllowedString https://github.com/rhyous/StringLibrary/blob/master/src/Rhyous.StringLibrary.Shared/Enum/AllowedString.cs A class that is a wrapper to a string and allows for you to define a list of allowed strings.
String to Expression extensions: https://github.com/rhyous/StringLibrary/blob/master/src/Rhyous.StringLibrary.Shared/Expression/PropertyNameLambdaExtensions.cs This is pretty cool. If you have a property name and want to convert it to an Expression, you can do so.
Remove Diacritics from a string: https://github.com/rhyous/StringLibrary/blob/master/src/Rhyous.StringLibrary.Shared/Globalization/GlobalizationStringExtensions.cs This allows you to create dictionaries
A pluralization library. https://github.com/rhyous/StringLibrary/tree/master/src/Rhyous.StringLibrary.Shared/Pluralization This makes it easy to do pluralization, include custom pluralization. If a word is missing, it is pretty easy to add to this library.
A crypto random string generator https://github.com/rhyous/StringLibrary/blob/master/src/Rhyous.StringLibrary.Shared/Random/CryptoRandomString.cs
Enhanced trimming abilities https://github.com/rhyous/StringLibrary/tree/master/src/Rhyous.StringLibrary.Shared/Trim The ability to trim all strings inside a complex object, which can and will trim nested complex objects as well. This is very useful for apis and inputs.
Have you heard of The Oft Forgotten Middle Trim, you can trim left and right and middle, with the TrimAll() extension method.
This project is very easy to contribute to. If you have a string extension or something you do with strings often, others probably will do the same. Having a common place for stable unit tests code is important.
Why contribute: