String functions in swift 5

Solution:

In swift 4 the below code is used for capitalise the first letter.

String(characters.prefix(1)).capitalized

In swift 5 below code is used for capitalise the first letter.

let first = String(prefix(1)).capitalized           

Comments

Popular posts from this blog

How to blink a button iOS swift?

iOS flutter while run to iPhone it had the error - Cannot find type 'PhoneNumberKit' in scope