StringRemoveParsed(string, string, string, int)

Given a source string, a parse string, and a delimiter string, this function returns the result of removing the leftmost (or rightmost) characters from the source string equaling the length of the parse string to include any trailing (or leading) delimiters found beyond (or before) that point.

string StringRemoveParsed(
    string sSource,
    string sParsed,
    string sDelimiter = " ",
    int bRightToLeft = FALSE
);

Parameters

sSource

The source string to be scanned.

sParsed

The parse string to look for in the source string.

sDelimiter

The delimiter string. (Default: a space " ")

bRightToLeft

A boolean parameter specifying the search direction. (Default: FALSE (left to right))


Description

Given a source string, a parse string, and a delimiter string, this function returns the result of removing the leftmost (or rightmost) characters from the source string equaling the length of the parse string to include any trailing (or leading) delimiters found beyond (or before) that point.



Remarks

The content of the parse string specified in the sParsed parameter is ignored. Only its length is important.

If the parse string specified in the sParsed parameter is blank, the source string is trimmed of all consecutive delimiters found at either the left or right end depending on the value of the bRightToLeft parameter, and the resulting string is returned.

If the delimiter string specified in the sDelimiter parameter is blank, the function trims off N characters from either the left or right end of the source string depending on the value of the bRightToLeft parameter, where N is the length of the string specified in the sParsed parameter. It then returns the resulting string.

If both the parse string specified in the sParsed parameter and the delimiter string specified in the sDelimiter parameter are blank, the entire source string is returned.

If the boolean parameter bRightToLeft is TRUE, the trimming is performed on the right end of the source string.

If the boolean parameter bRightToLeft is FALSE (the default), the trimming is performed on the left end of the source string.


Requirements

#include "x3_inc_string"

Version

1.69

Example

See StringParse

See Also

functions:  StringParse | StringReplace | FindSubString | GetSubString
categories:  String Functions


author: Axe Murderer, editors: Mistress, Kolyana