Archive: Search String in a line


Search String in a line
hi, How do u search a string in a line and only return the string which i search of?


Err... I want to do something like this.

Search for a string in a line and return the string.
So if the string is found, can call a function.

But how do we search the string and return the string only to use it in a if sentence to call a function if correct.

Thy if you could help!!


You can use StrStr to find the string. There is no need to get just that string. If the string isn't found, it'll return an empty string. Check if the return value is an empty string and if it isn't, use the string you were looking for as the result.


Originally posted by kichik
If the string isn't found, it'll return an empty string.
That's exactly the piece of information I was looking for. I was reading the ${StrStr} section in StrFunc.txt and was able to find what this function returns if the string is found, but not what it returns when the string is NOT found.

Now I know that it returns an empty string. :)

It would be nice to add this to the documentation (StrFunc.txt).