find a word in a string!

Anything and all.

Moderators: Murderator+, Murderator

Post Reply
dagofee
Posts: 10
Joined: 2006-10-29 18:32:39

find a word in a string!

Post 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
Savage
Expert!
Posts: 1205
Joined: 2004-04-04 11:13:54
Location: Балаково, Саратовская обл.
Contact:

Post by Savage »

Code: Select all

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