How can i convert an integer say 0 to a , 1 to b , 2 to c in Swift . I know in C++ and Python but could not find a straight forward way in swift
C++ code below
char a = 0 + 97;
char b = 1 + 97;
How can i convert an integer say 0 to a , 1 to b , 2 to c in Swift . I know in C++ and Python but could not find a straight forward way in swift
C++ code below
char a = 0 + 97;
char b = 1 + 97;
You can achieve the same thing in Swift like this:
let a = Character(UnicodeScalar(0 + 97))
let b = Character(UnicodeScalar(1 + 97))