Trims characters from the left side of a string.
LTrim (string [, char ])
String - (Input, expression, Required)
Specifies the string to be trimmed. If a numeric value is passed, it is first converted into a string. If a non-string value is passed, the result is Error. If Null is passed, Null is returned.
Char - (Input, expression, Optional)
Specifies the character to be removed from the left side of the string. If this parameter is omitted, the space character is assumed. If this string contains multiple characters, only the first character is used. If a numeric value is passed, it is first converted into a string. If Error is passed, the result is Error. If Null is passed, a space is assumed.
A copy of the passed string trimmed of any leading characters matching char.
LTrim (“abc”) |
Returns “abc” |
LTrim (“ abc “) |
Returns “abc “ |
LTrim (“ abc ”, “ “) |
Returns “abc ” |
LTrim (“ abc “, “a”) |
Returns “ abc “ |
LTrim (“---abc---”, “-”) |
Returns “abc---” |
LTrim (Null) |
Returns Null |
LTrim (Error) |
Returns Error |
LTrim (“ abc ”, Null) |
Returns “abc ” |
LTrim (“ abc ”, Error) |
Returns Error |
Functions are specifically for use in the Macro Editor. Refer to Microsoft's official VB and JScript documentation for scripting equivalents.
Functions | Asc function | Chr function | CSet function | Format function | InStr function | LCase function | Left function | Len function | LSet function | LTrim function | Mid function | Replace function | Right function | RSet function | RTrim function | Space function | String function | TCase function | Trim function | UBound function | UCase function
© 2004-2021 looksoftware. All rights reserved.