ord()
The ord()
method returns the ordinal (Integer) value of a Char or any enumerable type value.
The concrete return type is Int16
for a char and the underlying integer type of the enum for enumerable types.
Syntax:
method ord(c: Char): Integer;
int ord(char c);
func chr(_ c: Char) -> Int
int ord(Char c);