문제

I want to check if a line contains a specific word, so I tried to use the String.isSubstring function with the line and the specific word. But somehow that function dosn't work for me.

String.isSubstring("Hi my name is...", "name"); stdIn:2.1-2.47 Error: operator and operand don't agree [tycon mismatch] operator domain: string operand: string * string in expression: String.isSubstring ("Hi my name is...","name") -

I will love if some one can tell me what did i do wrong? Thanx

도움이 되었습니까?

해결책

String.isSubstring is a curried function -- that is, its arguments are passed in separately, not as a tuple.

Try

String.isSubstring "Hi my name is..." "name"
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top