Comparing Strings

emerald

Active Member
is there a way to compare strings to see if a string is in another string? example:

variable string name
variable string look

name:Set["Batch of Cotton Robes"]
look:Set["Batch of"]


I want to see if the string look exists in the string name.

Is this doable?


Thanks
 

detzX

Active Member
declare name1 string "fred"
declare name2 string "george"
if ${name1.Equal[${name2}]}
{
echo We're both named fred!
}
 

Amadeus

The Maestro
Staff member
Also
Code:
declare name1 string "fred"
declare name2 string "freddy"
if ${name2.Find[${name1}]}
{
echo '${name2}' contains '${name1}' within it!
}
 

v01d

Well-Known Member
variable string name
variable string look

name:Set["Batch of Cotton Robes"]
look:Set["Batch of"]

This statement will return TRUE if the value of look is contained within the value of name. Refer to the string type in the LavishScript wiki.

if ${name.Find[${look}]}

v01d

Looks like Ama beat me to the post.
 
Top Bottom