Answers for "get the first character of the string text in swift 5"

0

swift 5 get first character of string

Swift 5
let str = "abcdef"
print( String(str.characters.prefix(1)) ) // output: "a"
print( String(str.characters.prefix(3)) ) // output: "abc"
Posted by: Guest on June-12-2021

Code answers related to "get the first character of the string text in swift 5"

Code answers related to "Swift"

Browse Popular Code Answers by Language