I have a function that returns the char at a location:
let NthChar inpStr indxNum =
if inpStr.Length >=1 then printfn "Character %s" inpStr.[indxNum];
else printfn "Not enough arguments"
Error for
inpStr.Length
and
inpStr.[indxNum]
Error trace:
Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved.
String.lengthfunction instead of the String type'sLengthproperty. - ildjarnopen System let NthChar inpStr indxNum = if inpStr |> String.IsNullOrWhiteSpace || indxNum > (inpStr |> String.length) then printfn "Not enough arguments" else printfn "Character %A" inpStr.[indxNum]- FoggyFinder