Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

F# String to int conversion [duplicate]

Tags:

string

integer

f#

How do i convert from string to int in F#?

As an example i'd like to pass let someString = "123 to let someInt = 123 I cant really find any parse methods that work for me.. This question is not about parsing from int to String, but string to int. Not duplicate of a related question. Any ideas?

Thanks in advance

like image 761
Anders Lassen Avatar asked Nov 07 '16 22:11

Anders Lassen


1 Answers

Try built-in int function.

let someString = "123" 
let someInt = someString |> int // someInt now contains 123 int value
like image 88
Dzoukr Avatar answered Nov 20 '22 16:11

Dzoukr