Cent
Cent copied to clipboard
String extension case functions behaving unexpectedly for "vitaminB3"
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"]