LTrim Function | |
Remove leading spaces from a string.
Namespace:
XSharp.Core
Assembly:
XSharp.Core (in XSharp.Core.dll) Version: 2.19
Syntax FUNCTION LTrim(
cString AS STRING
) AS STRING
public static string LTrim(
string cString
)
Request Example
View SourceParameters
- cString
- Type: String
The string to trim.
Return Value
Type:
StringcString with the leading spaces removed.
If
cString is a NULL_STRING or all spaces, LTrim() returns a NULL_STRING.
Remarks
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.
Examples
These examples illustrate LTrim() used with several other functions:
1nNumber = 18
2? Str(nNumber)
3? SLen(Str(nNumber))
4? LTrim(Str(nNumber))
5? NTrim(nNumber)
6? SLen(LTrim(Str(nNumber)))
See Also