Humanizr / Humanizer

Humanizer meets all your .NET needs for manipulating and displaying strings, enums, dates, times, timespans, numbers and quantities

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem in Camelize method

Nefcanto opened this issue · comments

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

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

@SimonCropp, I have also reported #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.