LTrim

Description

Removes leading spaces from a string.

Returns

A copy of the string, without leading spaces.

Function syntax

LTrim(string)

See also

RTrim, ToBase64

Parameters

Parameter

Description

string

A string or a variable that contains one

Example

<h3>LTrim Example</h3> 
 
<cfif IsDefined("FORM.myText")> 
<cfoutput> 
<pre> 
Your string:    "#FORM.myText#" 
Your string:    "#LTrim(FORM.myText)#" 
(left trimmed) 
</pre> 
</cfoutput> 
</cfif> 
 
<form action = "ltrim.cfm"> 
<p>Type in some text, and it will be modified by LTrim to remove  
    leading spaces from the left 
<p><input type = "Text" name = "myText" value = " TEST"> 
 
<p><input type = "Submit" name = ""> 
</form>