Page 1 of 1

cut a part out of a text...

Posted: Wed Dec 09, 2009 6:07 pm
by aerypton
I want to cut a part out of a text.
For example: I need the part between "," and " and" from "This is a test, a second test and a third test."

In php there is something like "substr" and "strstr".
But is there a function in Revolution that does what I want?
I have been search the red in my eyes... But I didn't find it.

Can anyone help me?

Re: cut a part out of a text...

Posted: Wed Dec 09, 2009 6:27 pm
by dunbarx
Easy, you just need to cut up text the way you like. Is the example you posted typical of what you always will be dealing with? The following script assumes this:

Code: Select all

on mouseup
   put item 2 of  yourData into yourString
   answer char 1 to  offset("and",yourString)  + 3 of yourString --did you want the "and"?
   answer char 1 to  offset("and", yourString) - 1 of  yourString -- or not
end mouseup
This can be extended and generalized once you get the idea.

Re: cut a part out of a text...

Posted: Wed Dec 09, 2009 8:39 pm
by aerypton
phoe... it is so easy that I didn't found it... :roll: :D
Thanx