How can I get a char from a string

Monkey Forums/Monkey Programming/How can I get a char from a string

frank(Posted 2012) [#1]
I am now using:

Local c:String = Self.code[i..i+1]

Select c
Case "'" ' comment

because I need to use c as char (not char code) more afterwards, so I take a slice instead of an index; is there a better way to do this?


Halfdan(Posted 2012) [#2]
I use String.FromChar(c) to convert charcode to String, don't think it makes a big difference

Local str := "Hello' "
Local c := String.FromChar(str[5])
...