I am new to F # and I have not been able to find the last element of a number string and convert this element to int. Therefore, if the line was "123", then I would like to go back 3. However, this code:
let s (a : string) =
let x = a.[0]
int x
This returns me 49 when I do s "123". I can’t understand why this is happening. Also, when I entered the string “124”, it still gives me 49. Can someone explain why this is happening and how can I fix it?
source
share