trimleft

The trimleft function enables you to remove white space from the left side of a string by default. You can also specify a character for the trimleft function to remove from the left side of a string. If you want to remove a character, specify the character in the appropriate case (upper- or lowercase).

Syntax

Use this syntax:


string = trimleft(string_to_trim) or 
string = trimleft(string_to_trim, character_to_trim)
 
where: string = string field that contains the end result
       string_to_trim = string field containing the value to be trimmed
       character_to_trim = character to trim from string (no empty spaces)

Examples

Use the following syntax to remove white space from the left side of the string:


string [25] s;
s = "   my String   ";
$Groupname[1].#Value = trimleft(s);
 
//$Groupname[1].#Value now contains the value "my String   "

Use the following syntax to remove a leading character:


string [25] s1;
s1 = "zzzString";
$Groupname[1].#Value = trimleft(s1,"z");
 
//$Groupname[1].#Value now contains the value "String"

For similar examples, see trim.