RTrim Function | |
Remove trailing spaces from a string.
Namespace:
XSharp.VFP
Assembly:
XSharp.VFP (in XSharp.VFP.dll) Version: 2.19
Syntax FUNCTION RTrim(
Expression AS STRING,
Flags AS LONG,
TrimChars PARAMS STRING[]
) AS STRING
public static string RTrim(
string Expression,
int Flags,
params string[] TrimChars
)
Request Example
View SourceParameters
- Expression
- Type: String
Specifies an expression to remove leading spaces or 0 bytes from, respectively - Flags
- Type: Long
- TrimChars
- Type: String
Specifies one or more character strings that are trimmed from the beginning of cExpression.
If cParseChar isn't included, then leading spaces or 0 bytes are removed from Expression.
Return Value
Type:
StringcString with the trailing spaces removed.
If
cString is a NULL_STRING or all spaces, RTrim() returns a NULL_STRING.
Remarks
RTrim() is the same as Trim(). See Trim() for details.
Examples
This is a function in which RTrim() formats city, state, and zip code fields for labels or form letters:
1FUNCTION CityState(cCity, cState, cZip)
2 RETURN RTrim(cCity) + ", " ;
3 + RTrim(cState) + " " + cZip
To complete the example the function, CityState(), displays a record from CUSTOMER.DBF:
1USE customer INDEX custname NEW
2SEEK "Kate"
3? CityState(City, State, ZipCode)
See Also