Humanizr / Humanizer

Humanizer meets all your .NET needs for manipulating and displaying strings, enums, dates, times, timespans, numbers and quantities
Other
8.59k stars 955 forks source link

Problem in Camelize method #1397

Open Nefcanto opened 6 months ago

Nefcanto commented 6 months ago

Simply run this code:

var kebabed = "some-text-here"; var camelized = kebabed.Camelize(); Console.WriteLine(camelized); // prints some-text-here instead of someTextHere

var dotted = "some.text.here"; var camelized = dotted.Camelize(); Console.WriteLine(camelized); // prints some.text.here instead of someTextHere

SimonCropp commented 6 months ago

@hazzik @hangy @MehdiK any opinions on what should be the correct behavior in this scenario

Nefcanto commented 6 months ago

@SimonCropp, I have also reported https://github.com/Humanizr/Humanizer/issues/1282.

The point is, the camelCasing, PascalCasing, kebab-casing, and snake_casing conventions are clear. The source should be converted into the target. In the camelCasing convention, you should only see alphanumeric characters, and no hyphens or underline should exist between words.