Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP General (http://www.velocityreviews.com/forums/f65-asp-general.html)
-   -   using replace and trim together (http://www.velocityreviews.com/forums/t796481-using-replace-and-trim-together.html)

Joey 09-24-2004 01:31 PM

using replace and trim together
 
This should not be this tough but I may be thinking too hard about it.

Here's what I have:

thenames="charles,sam,chris,"

How do I do remove the last comma? I tried using trim and replace
together but couldn't get it.

Thanks!



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Aaron [SQL Server MVP] 09-24-2004 01:34 PM

Re: using replace and trim together
 
if right(thenames, 1) = "," then
thenames = left(thenames, len(thenames)-1)
end if

--
http://www.aspfaq.com/
(Reverse address to reply.)




"Joey" <nospam@infosmiths.net> wrote in message
news:u6nyDrjoEHA.1272@TK2MSFTNGP09.phx.gbl...
> This should not be this tough but I may be thinking too hard about it.
>
> Here's what I have:
>
> thenames="charles,sam,chris,"
>
> How do I do remove the last comma? I tried using trim and replace
> together but couldn't get it.
>
> Thanks!
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!




Evertjan. 09-24-2004 01:45 PM

Re: using replace and trim together
 
Joey wrote on 24 sep 2004 in microsoft.public.inetserver.asp.general:

> This should not be this tough but I may be thinking too hard about it.
>
> Here's what I have:
>
> thenames="charles,sam,chris,"
>
> How do I do remove the last comma? I tried using trim and replace
> together but couldn't get it.
>


ASP jscript:

thenames = thenames.replace(/,$/,'')

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)



All times are GMT. The time now is 08:19 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.