LTrim() removes leading spaces, RTrim() removes trailing spaces, and Trim() removes both leading and trailing spaces.
Dim my_string
my_string=" Welcome to Plus2net.com"
Response.Write "Before removing space =|" & my_string & "|"
my_string=LTrim(my_string)
Response.Write "<br>After removing space =|" & my_string & "|"
Before removing space =| Welcome to Plus2net.com|
After removing space =|Welcome to Plus2net.com|
The vertical bars make the leading space visible in the output.
my_string=RTrim(my_string)
my_string=Trim(my_string)
Null, the result is Null.Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.