Working with Strings

BlitzPlus Forums/BlitzPlus Beginners Area/Working with Strings

Shack(Posted 2007) [#1]
I'm trying to create a hang-man like game. What I need is some command that will tell the computer whether a particular letter is in a certain string. That way, I can tell the user whether their guess was right or wrong.

I would appreciate any help.


CS_TBL(Posted 2007) [#2]
text$="abcdefghijklmnopqrstuvwxyz"
find$="o"
location=instr(text$,find$)

------

Now: location contains the position, if found. If not found it's 0.


Shack(Posted 2007) [#3]
Thanks a lot. That's exactly what I needed to know.


Yo! Wazzup?(Posted 2007) [#4]
Yeah, I've been wanting to do that for awhile.