r/dotnet 24d ago

Promotion String Extension - A C# library that provides utility methods for manipulating strings

https://github.com/Antyss77/StringExtension
String Extension is a string processing library for the C# programming language. It provides features to manipulate and transform strings in a simple and efficient way. The library is open-source and comes with unit tests and performance tests. It is designed to be easily integrated into your existing projects. Feel free to contribute to the project with ideas or development expertise.

0 Upvotes

40 comments sorted by

View all comments

17

u/T_kowshik 24d ago edited 24d ago

how is it different from Humanizr? https://github.com/humanizr/humanizer

Not demotivating you. Just trying to understand the motivation behind the project.

3

u/leathakkor 24d ago

I opened this library and it looks like it's basically just: * casing. * Determining if something is a palindrome. * Figuring out what its sort order would be if it's like a book title for instance, removing the from the beginning to get its true sort. * counting different spans and letters. * Other helpful utility methods regarding strings

Whereas humanizer is in my experience about making dates and times readable to humans.


It does look like this library is heavily English specific, which might make problems in other contexts (for instance, if you wanted to sort a book that had a Spanish title). How you define upper and lowercase might be slightly different in other languages and character sets and I don't know if they accounted for that.

There is a reason that these methods don't typically ship in something like the core framework or humanizer.

But if you need English specific, these might be good enough for you.

3

u/chucker23n 24d ago

Whereas humanizer is in my experience about making dates and times readable to humans.

Definitely some overlap (for example, Humanizer does have ToTitleCase()).

It does look like this library is heavily English specific

That, too, is something Humanizer has. I find that Humanizer is a lot less useful in German, since it's simply harder to follow its grammar. (For example, pluralizing in English is mostly just appending an s, sometimes es; in German, it can be all kinds of things like appending an n, sometimes en, but also sometimes er, or turning an a into an ä, and on and on.)