Trim Function

Tips >>ASP Functions

WANTS TO MAKE SOFTWARE WITHOUT KNOWLEDGE OF ASP? CLICK HERE


The Trim function removes spaces on both sides of a string. You can use the Trim function to remove spaces on both the left and the right side of a string. In other words, The Trim function removes extra blank spaces on both the right and left side of a string.

Note :- The HTML automatically removes extra blank spaces in this view.

The Syntax of the Trim function is :-

Trim(string)

Its Description is :-

Parameter Description
string Required. A string expression

Example#1 :-

Code :-
dim txt
txt=" This is a beautiful day! "
document.write(Trim(txt))
Output :-
"This is a beautiful day!"

Example#2 :-

Code :-
<%
myString=" This is an example using the Trim function. "
Response.write Trim(myString)
%> #ECFFFC
Output :-
This is an example using the Trim function.

Example#3 :-

Code :-
<%
=Trim(" How now brown cow? ")
%>
Output :-
How now brown cow?

 

Note :- The extra white spaces are removed from both sides.

 

 
E-mail : sales@virtualsplat.com
Phone : +91-9892413501

Whatsapp Icon +91-9967648641

Whatsapp Icon +91-9967648641