Trim() function example
Here is an example of trimming both leading and trailing spaces from a character string stored in a variable:
<% 'BEGIN ASP SCRIPT
Dim cTest, cNew 'Initialize a couple of
cTest = "this is a test"
cNew = Trim(cTest)
<!–END ASP SCRIPT ––>
The new value is <%=cNew%>.
The output from this code segment would be:
The new value is this is a test.
This function could be useful in joining data from multiple fields (first name in one field, last name in another) or a
text field in an HTML FORM in which the user may have put in a blank line or spaces before or after the actual text.