Remove leading spaces from a string.
XSharp.Core (in XSharp.Core.dll) Version: 2.2a
Syntax View Source
cString AS STRING
) AS STRING
public static string LTrim(
- Type: String
The string to trim.
<cString> with the leading spaces removed. If <cString> is a NULL_STRING or all spaces, LTrim() returns a NULL_STRING.
LTrim() is used to format strings that have leading spaces, for example, numbers that have been converted to strings using Str().
LTrim() is related to RTrim(), which removes trailing spaces, and AllTrim(), which removes both leading and trailing spaces. The inverse of AllTrim(), LTrim(), and RTrim() are the PadC(), PadR(), and PadL() functions, which center, right-justify, and left-justify strings by padding them with fill characters.
These examples illustrate LTrim() used with several other functions:
nNumber = 18
? Str(nNumber) // 18
? SLen(Str(nNumber)) // 10
? LTrim(Str(nNumber)) // 18
? NTrim(nNumber) // 18
? SLen(LTrim(Str(nNumber))) // 2