help with trim function

M

Mikael Hellström

Hi all,
i need to use the trim function trim("str","?")
My question are. How do i remove the "return sign" from a string??
Regards Mikael
 
H

Harag

The Trim function only takes one parameter, the string itself

DIM str
str = " my text "
str = Trim(str)

All trim does is remove the spaces from the front & the back of the
string.

If you need to remove other characters then you need to use the
replace function

str = Replace(str, vbcr, "")

This will remove all the "return sign" from the string.

I often use this:

str = Replace (str, vbcrlf, "<br>")

to convert all the returns & line feed characters into a html Break
"<br>" This is used for like a forum system when a user enters text in
a textbox but you then want to display that text on the HTML page like
in a forum.



HTH.

Al
 

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

Similar Threads

Right trim string function in C 54
Need help with this script 4
trim whitespace v3 170
Sort by number of characters 0
ASP 0115 1
Help with passing test 3
Help with a function 8
Pandas question 0

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top