<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../../style.css">
<title>
Gambas Documentation - String.Left
 (gb)</title>
</head>
<table class="none" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr><td align="left">
<font size="-1">
<a href="../../../../help+en"><img class="flag" alt="Home" border="0" src="../../../../img/lang/en.png" align="center"></a>&nbsp;
<a href="../string+en">Up</a>&nbsp;
<a href="lcase+en">Previous</a>&nbsp;
<a href="len+en">Next</a>&nbsp;
</td></tr></table>
<div class="notab">
<h1>
String.Left
 (gb)</h1>
<div class="black"><font size="-2"><b>Syntax</b></font></div>
<pre class="syntax"><font color="blue">STATIC</font> <font color="blue">FUNCTION</font> <b>Left</b> <font color="blue">(</font> <u>String</u> <font color="blue">AS</font> <font color="#0080FF">String</font> <b>[</b> <font color="blue">,</font> <u>Length</u> <font color="blue">AS</font> <font color="#0080FF">Integer</font> <b>]</b> <font color="blue">)</font> <font color="blue">AS</font> <font color="#0080FF">String</font></pre>
Returns the <u>Length</u> first characters of an <a href="../../../def/utf8+en">UTF-8</a> string.
<p>
If <u>Length</u> is not specified, the first character of the string is returned.
<p>
If <u>Length</u> is negative, all the string except the (- <u>Length</u> ) last characters is returned.
<p>
<div class="warning"><table class="none" border="0"><tr><td width="40" valign="top"><img border="0" src="../../../../img/warning.png" align="center"></td><td valign="top">
This function deals with UTF-8 strings, and so all positions and lengths are given in characters and not in bytes.
</td></tr></table></div>

</div>
</body>
</html>

