PDA

View Full Version : Need a function for letter help.


ShadowUK
04-25-2008, 01:27 PM
Basically I have this string:

"Blah blah, <This is an> example".

I'm trying to get inbetween the < and the > removed.
So I'm looking for it to turn out as:

"Blah blah, example".

I'd seriously appreciate help.

RizlaUK
04-25-2008, 02:05 PM
here you go ;)

function RemoveString(strText)
local nStart = String.Find(strText, "<", 1, false);
local nFinish = String.Find(strText, ">", nStart, false);
local strTrim = nFinish-nStart+1
local strRemove = String.Mid(strText, nStart, strTrim);
return String.Replace(strText, strRemove, "", false);
end


--test
Dialog.Message("Notice", RemoveString("Blah blah, <This is an> example"));

ShadowUK
04-25-2008, 02:22 PM
Genius!

Thank you!

RizlaUK
04-25-2008, 02:32 PM
np m8 :yes

RizlaUK
04-25-2008, 02:35 PM
Hey Shadow, just wondering, what part of london you in, im in West, Shepherds Bush

ShadowUK
04-25-2008, 03:08 PM
I live in Carshalton, in surrey.

RizlaUK
04-25-2008, 03:12 PM
cool, do you know the sutton arms (in sutton), my bro used to run it