There are several different options for this.
Given what System.Stringthe sequence of characters you currently use to turn into a list is, you can skip the conversion of lists and just use it Seq.forallfor direct testing:
let strContainsOnlyNumber (s:string) = s |> Seq.forall Char.IsDigit
, , :
let strContainsOnlyNumber (s:string) = System.Int32.TryParse s |> fst
, true , "-342" ( -, ).
:
let numberCheck = System.Text.RegularExpressions.Regex("^[0-9]+$")
let strContainsOnlyNumbers (s:string) = numberCheck.IsMatch s
, , .
, , , :
let tryToInt s =
match System.Int32.TryParse s with
| true, v -> Some v
| false, _ -> None
, ( Option.isSome), , .
, - Int32.TryParse Double.TryParse, float.