AllTrim Function | |
Remove leading and trailing spaces from a string.
Namespace:
XSharp.Core
Assembly:
XSharp.Core (in XSharp.Core.dll) Version: 2.21
Syntax FUNCTION AllTrim(
cString AS STRING
) AS STRING
public static string AllTrim(
string cString
)
Request Example
View SourceParameters
- cString
- Type: String
The string to trim.
Return Value
Type:
String
A trimmed string, with leading and trailing spaces removed.
Return Value
Type:
StringA trimmed string, with leading and trailing spaces removed.
Remarks
AllTrim() is related to LTrim() and RTrim(), which remove leading and trailing spaces, respectively.
The inverse of AllTrim(), LTrim(), and RTrim() are the PadC(), PadL(), and PadR() functions, which center, left-justify, and right-justify strings by padding them with fill characters.
Examples
This example creates a string with both leading and trailing spaces, then trims them with AllTrim():
1LOCAL cString AS STRING
2cString := SPACE(10) + "string" + SPACE(10)
3? SLen(cString)
4? SLen(ALLTRIM(cString))
See Also