Cent icon indicating copy to clipboard operation
Cent copied to clipboard

String extension case functions behaving unexpectedly for "vitaminB3"

Open bradwbradw opened this issue 6 years ago • 0 comments

let nutrient = "vitaminB3"
print(nutrient.startCase)

// prints "Vitamin 3", but I expected "Vitamin B3"

A similar thing happens for snakeCase. I've gone and inspected Cent's internal .words() function, and it seems to be the culprit, since the array would be ["vitamin", "3"] instead of ["vitamin", "B3"]

bradwbradw avatar Aug 13 '18 18:08 bradwbradw