Shmuli
Shmuli

Reputation: 155

String.isSubstring dosnt work - sml

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

Upvotes: 0

Views: 388

Answers (1)

qaphla
qaphla

Reputation: 4733

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"

Upvotes: 2

Related Questions