IIS ASP - using replace and trim together

This is Interesting: Free IT Magazines  
Home > Archive > IIS ASP > September 2004 > using replace and trim together





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author using replace and trim together
Joey

2004-09-24, 7:48 am

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.codecomments.com ***
Don't just participate in USENET...get rewarded for it!
Aaron [SQL Server MVP]

2004-09-24, 7:48 am

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.codecomments.com ***
> Don't just participate in USENET...get rewarded for it!



Evertjan.

2004-09-24, 5:51 pm

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)

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com