I'm looking to capitalise the first letter of each word in a string. For Example:
stack overflow --> Stack Overflow
STACK OVERFLOW --> Stack Overflow
Does anyone know to accomplish this in swift 3?
I'm looking to capitalise the first letter of each word in a string. For Example:
stack overflow --> Stack Overflow
STACK OVERFLOW --> Stack Overflow
Does anyone know to accomplish this in swift 3?
Call capitalized function on your string as follows.
var str = "hello, playground"
str.capitalized
print(str.capitalized)
Output
Hello, Playground