using replace and trim together

J

Joey

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!
 
A

Aaron [SQL Server MVP]

if right(thenames, 1) = "," then
thenames = left(thenames, len(thenames)-1)
end if
 
E

Evertjan.

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(/,$/,'')
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top