PDA

View Full Version : strip %0A%09%09



DaDeViL
July 28th, 2004, 06:14 PM
hello,
I need to strip '%0A%09%09' from the end of a string...what should I use to do it? I tried searching for '%0A%09%09' in 'righthalf%0A%09%09' but it returned as undefined...do i use it like this? :ear:


a= a.search("%0A%09%09");

Thanks

McGiver
July 28th, 2004, 06:39 PM
a="righthalf%0A%09%09"
//use to convert it into plain text:
b=unescape(a)
//use to find out the position where a string appears first in another string:
b=a.indexOf("%0A%09%09")
//use to give return the string except %0A%09%09 stuff:
b=a.substring(0,indexOf("%0A%09%09"))

DaDeViL
July 28th, 2004, 06:57 PM
Thanks for the quick reply.

when i try this:



b=a.substring(0,indexOf("%0A%09%09"))


the string i get is the same one i put in ('righthalf%0A%09%09')

McGiver
July 28th, 2004, 07:08 PM
oups, sorry
of course it's
b=a.substring(0,a.indexOf("%0A%09%09"))

DaDeViL
July 28th, 2004, 07:22 PM
ahh! perfect... i should have that of that doh! lol

Thanks a lot, it works now!