Replace all white space at the end of a string

J

j1c

Does anyone have an example of how to replace all whitespace at the end
of a string??

I'm trying something like:
do while right(str,1) = " "
str = replace(right(str,1)," ","")
loop
response.write("str:" & str)
.... but it is killing off the entire string ...

str:
 
G

Gérard Leclercq

Mytext=Rtrim(Mytext)
Mytext=Ltrim(Mytext) 'left side
Mytext=Trim(Mytext) 'both
 

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

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top