stencilproject / Stencil

Stencil is a simple and powerful template language for Swift.
https://stencil.fuller.li
BSD 2-Clause "Simplified" License
2.34k stars 223 forks source link

Titlecase filter #180

Closed ilyapuchka closed 6 years ago

AliSoftware commented 6 years ago

Is it the same transformation as the upperFirstLetter from StencilSwiftKit?

Note that in the common vocabulary (and Foundation implementation for example), titlecase turns the first letter to uppercase… but also turns the other letters to lowercase (while our upperFirstLetter only uppercase the first letter letting the others unchanged).

So "datePicker"|titlecase would be "Datepicker" while "datePicker"|upperFirstLetter would be "DatePicker"

AliSoftware commented 6 years ago

Also be sure to check if capitalize isn't the same as your titlecase too (which is one provided by Stencil itself iirc)

ilyapuchka commented 6 years ago

you're right, capitalise already doing it