Page 1 of 1

find a word in a string!

Posted: 2006-11-01 22:25:30
by dagofee
i have a string like this
VAR STRING="I'm very very happe to be here"
how can I see if in a string like this we have a specific word?

i tried to separate each word but shit, it doesen't go

sub main()
var l,variable
var i=0
var tmp=0
VAR frase="la mamma di fara e' una puttana di prima riga"
VAR TROVA="puttana"

while i<len(frase)
for i=0 to len(frase)
l=mid(frase,i,1)
if l == ' ' then
i=i+tmp+1
goto x
end if
next
x:

variable=mid(frase,tmp,i)
tmp=i
uo.print("-"+str(variable)+"-")
wait(1000)
wend
end sub

Posted: 2006-11-01 23:22:35
by Savage

Code: Select all

UO.InJournal("I'm very very happe to be here")