I have to make a code that checks whether a certain letter is in a word

The problem that I am encountering is that the value of i only reports the first letter of the word, not the whole thing. Like if I say "is there is a w in water", it will say true, but if I say "if there is a t in water", it will report false. How do I make it so that it works for all the letters?

welcome to the forums! this script can detect wether the letter 't' is in 'water' and you can just replace those 2 with whatever you need.
untitled script pic (43)

In this library:
image
it work for 1 or multible letters substring:
DefautProject script pic (9)
DefautProject script pic (10)
DefautProject script pic (11) :grinning:

you got a bunch of good, simple, easy quick answers, now heres a long, drawn out, unnecessary answer that may help explain it a bit more
for (i) = (1) to (([length V] of text [water])) { if <(letter (i) of [water]) = [w]> then { report <true> } else { if <(letter (i) of [water]) = [t]> then { report <false> }

what's the point of the if <(letter (i) of [water]) = [t]> { report <false>}?

that is correct, water contains h2o, not h20 :stuck_out_tongue: (sorry for double posting)

that's what they don't want.

Just for fun, a recursive solution:

..this was 13 days ago

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.