<html>
<head>
<link href="mmres://user_interface_reference.css" rel="stylesheet" type="text/css">
<title>LEFT</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
   <div id="Description">
   <table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
      <tr> 
         <td valign="top" class="name">LEFT</td>
         <td valign="top" nowrap class="compatibility">&nbsp;</td>
      </tr>
      <tr>
         <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
      </tr>


    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Description</span>
<p>
Returns the leftmost <i>count</i> characters in a string.
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Returns</span>
<p>
String; the first <i>count</i> characters in the string parameter.
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Category</span>
<p>
String functions
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Function syntax</span><pre>Left(string, count)
</pre>    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">See also</span>
<p>
Right, Mid, Len
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Parameters</span>
<p>

</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Example</span><pre>&lt;h3&gt;Left Example&lt;/h3&gt;

&lt;cfif IsDefined(&quot;Form.myText&quot;)&gt;
&lt;!--- If len returns 0 (zero), then show error message. ---&gt;
   &lt;cfif Len(Form.myText)&gt;
      &lt;cfif Len(Form.myText) LTE Form.RemoveChars&gt;
         &lt;cfoutput&gt;&lt;p style=&quot;color: red; font-weight: bold&quot;&gt;Your string 
#Form.myText# only has #Len(Form.myText)# characters. You cannot output 
   the #Form.removeChars# leftmost characters of this string because it is 
   not long enough.&lt;/p&gt;&lt;/cfoutput&gt;
      &lt;cfelse&gt;
         &lt;cfoutput&gt;&lt;p&gt;Your original string: &lt;strong&gt;#Form.myText#&lt;/strong&gt;&lt;/p&gt;
            &lt;p&gt;Your changed string, showing only the &lt;strong&gt;#Form.removeChars#
               &lt;/strong&gt; leftmost characters:
               &lt;strong&gt;#Left(Form.myText, Form.removeChars)#&lt;/strong&gt;&lt;/p&gt;
         &lt;/cfoutput&gt;
      &lt;/cfif&gt;
   &lt;cfelse&gt;
      &lt;p style=&quot;color: red; font-weight: bold&quot;&gt;Please enter a string of more 
than 0 (zero) characters.&lt;/p&gt;
&lt;/cfif&gt;
&lt;/cfif&gt;

&lt;form action=&quot;&lt;cfoutput&gt;#CGI.ScriptName#&lt;/cfoutput&gt;&quot; method=&quot;POST&quot;&gt;
&lt;p&gt;Type in some text&lt;br /&gt;
&lt;input type=&quot;Text&quot; name=&quot;myText&quot;&gt;&lt;/p&gt;
&lt;p&gt;How many characters from the left do you want to show?
&lt;select name=&quot;RemoveChars&quot;&gt;
&lt;option value=&quot;1&quot;&gt;1
&lt;option value=&quot;3&quot; selected&gt;3
&lt;option value=&quot;5&quot;&gt;5
&lt;option value=&quot;7&quot;&gt;7
&lt;option value=&quot;9&quot;&gt;9&lt;/select&gt;
&lt;input type=&quot;Submit&quot; name=&quot;Submit&quot; value=&quot;Remove characters&quot;&gt;&lt;/p&gt;
&lt;/form&gt;
</pre>
         </td>
      </tr>
   </table>
   </div>
<div id="STRING">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">STRING</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>


<p>A string or a variable that contains one. </p>

  </td>
  </tr>
  </table>
</div>
<div id="COUNT">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">COUNT</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>


<p>A positive integer or a variable that contains one. Number of characters to return.</p>

  </td>
  </tr>
  </table>
</div>

  </body>
</html>
