Hi Matt,
have you tried .replace(/.*?[[]]*$/,"") instead of .replace(/$[]]/g,"")?
Cheers,
Uli
Am 29.07.2011 14:45, schrieb Matthew Bramer:
Normally, my google skills work wonders in these situations, but I'm
not able to find the answer. After searching for 2 days or so, I
figured someone would know the answer here.
stringValue.replace(/^[[]/g,"").replace(/$[]]/g,"").replace(/"/g,"").replace(/'/g,"");
The first replace works great, it trims off the beginning "[". The
second replace doesn't work at all, even without the "$". The other 2
replace calls work fine.
I'm stuck on removing "]" from the string. Ideally, I'd like to know
how to replace this character from the end of a string and anywhere
within it. I know I can use substring, but this character may float
around the string. As it stands, it's only appearing at the end of
the string, but I know that's not going to be futureproof.
Do you guys have any advice?
Cheers,
Matt
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/[email protected]/
To search via a non-Google archive, visit here:
http://www.mail-archive.com/[email protected]/
To unsubscribe from this group, send email to
[email protected]
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/[email protected]/
To search via a non-Google archive, visit here:
http://www.mail-archive.com/[email protected]/
To unsubscribe from this group, send email to
[email protected]