« Return to Thread: Re: [OT] Jquery Remove Trailing "&" From String

Re: [OT] Jquery Remove Trailing "&" From String

by Brad Lindsay-2 :: Rate this Message:

Reply to Author | View in Thread

On Jul 6, 2009, at 2:37 PM, Jason Huck wrote:
> That's more of a general javascript question. It should be something  
> like this:
>
> var mystring = 'foooobaaaaarrrrr&';
> mystring = mystring.substr(0, mystring.length - 2);

As an FYI, this will always remove the last character of the string  
while my solutions only remove the character if it's an ampersand.

-Brad

--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/


 « Return to Thread: Re: [OT] Jquery Remove Trailing "&" From String