How to remove leading spaces from a string in ColdFusion

LTrim() - remove leading spaces from a string

LTrim.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>LTrim function example: how to remove leading spaces from a string</title>
</head>

<body>
<h2 style="color:HotPink">LTrim Function Example</h2>

<cfset TestString=" Test string for LTrim function">
<cfoutput>
<b>
TestString: [#TestString#]
<br />
TestString(after remove leading spaces): [#LTrim(TestString)#]
</b>
</cfoutput>

</body>
</html>





More ColdFusion examples