Character Replacement Functions
Description
Replace elements in a string.
- Name
- Description
- *REVERSE Function
Reverse the order of characters in a string.
- *s Function
Replaces placeholders with values defined locally in Xbasic variables.
- *token_translate Function
Replace Tokens in an expression token lists are cr-lf delimited of form <type>:<name> types are I-dentifier, F-unction, B-inary op, U-nary op, C-onst
- *TRANSPOSE Function
Transpose characters in a string.
- a5_stritran_multi_expression_Prepare Function
Before stritran_multi_expression() is called, sort the search/replace string by the length (descending) of the search strings.
- CHRTRAN Function
Replaces a portion of one string with another.
- CompileStringTemplate Function
Compile a string template that has expression enclosed in { }. Returns an object. Use <obj>.Output() to evaluate the string.
- EVALUATE_STRING Function
Replaces all variables/expressions in a string with their actual values. Variables/expressions are enclosed in { }. Use \{ or \} to escape the soft brace character.
- expand_tabs Function
Expand tabs into spaces.
- Filter_String_Smatch_Change Function
Change words (lines) of text that match a pattern.
- html_stritran Function
Perform stritran on the plaintext of html.
- html_strtran Function
Perform strtran on the plaintext of html.
- LINE_INSERT Function
Inserts a CRLF delimited string into another string at the specified position. Position can either be a line number or a string found in an existing line. Position can include wildcard characters. If before is .t. then insertion is made before position.
- MASK Function
Replace spaces in template with characters of string.
- REMSPECIAL Function
Strips all non-alphabetic and non-numeric characters and spaces from a string.
- STRIP_TRAILING_CHAR Function
Strips a trailing character from a string. Typically used to string a trailing backslash from a path.
- STRITRAN Function
Replaces each occurrence of a string with another - compare is case insensitive.
- STRITRAN_MULTI Function
Replaces occurrences of strings in one cr-lf list with strings in another cr-lf list - compare is case insensitive.
- Stritran_multi_expressions Function
Replaces occurrences of tokens before '=' with results of expression after '=' in cr-lf delimited list of pairs compare is case insensitive.
- STRITRAN_SMATCH Function
Replaces occurrences that match a pattern with another pattern.
- STRITRAN_SPECIAL Function
Searches for occurrences of a sub-string starting with 'start_string' and ending with 'end_string' and replaces with 'replace_string'. Replace_count specifies how many replacements to make. Default is 0, which indicates replace all occurrences. Search is case-insensitive.
- STRTRAN Function
Replaces each occurrence of a string with another.
- STRTRAN_MULTI Function
Replaces occurrences of strings in one cr-lf list with strings in another cr-lf list - compare is case sensitive.
- strtran_multi_expressions Function
Replaces occurrences of tokens before '=' with results of expression after '=' in cr-lf delimited list of pairs compare is case sensitive.
- STRTRAN_SMATCH Function
Replaces occurrences that match a pattern with another pattern.
- STRTRAN_SPECIAL Function
Searches for occurrences of a sub-string starting with 'start_string' and ending with 'end_string' and replaces with 'replace_string'. Replace_count specifies how many replacements to make. Default is 0, which indicates replace all occurrences. Search is case-sensitive.
- STRWORDITRAN Function
Replaces each occurrence of a word with another - compare is case insensitive.
- STRWORDTRAN Function
Replaces each occurrence of a word with another.
- STUFF Function
Alters a string by deleting characters and replacing them with another string.
- TOKEN_SEARCH_REPLACE Function
Search and replace tokens in an expression, useful for replacing fieldnames and subexpressions.
Related Functions
*LINE_REMOVE() - Removes line(s) of text in a CR-LF delimited string.
*LINE_REPLACE() - Replaces line(s) of text in a CR-LF delimited string.
*WORD_REMOVE() - Removes one or more words from a string.
*WORD_REPLACE() - Replaces one or more words in string.
COMMA_TO_CRLF() - Converts a comma delimited list to a CR-LF delimited list.
CRLF_TO_COMMA() - Converts a CR-LF delimited list to a comma delimited list.
REGEX_MERGE() - Searches Text for one or more matches to Search_Expresssion and conditionally performs replacement operations.
WORD_MOVE() - Moves a word or entry from one position to another in a CR-LF delimited list.
WORD_REMOVE() - Removes the word indicated by position from a CR-LF delimited list.
WORD_REPLACE() - Replaces a word or entry in a CR-LF delimited list.
WORD_SUBTRACT() - Removes all of the "words" in Excluded_Words from the list of words or entries in string. Case insensitive.
WORD_SUBTRACTC() - Removes all of the "words" in Excluded_Words from the list of words or entries in string. Case sensitive.
<StringScanner>.Replace() - Inserts and optionally replaces text in the StringScanner buffer.
<StringScanner>.ReplaceSmatch() - Replaces the first instance of Find_Text in the StringScanner buffer with Replace_Text. Supports the use of wildcard characters in Find_Text.
<StringScanner>.ReplaceSmatchI() - Replaces the first instance of Find_Text (case insensitive) in the StringScanner buffer with Replace_Text. Supports the use of wildcard characters in Find_Text.
<StringScanner>.ReplaceString() - Replaces the first instance of Find_Text in the StringScanner buffer with Replace_Text.
<StringScanner>.ReplaceStringI() - Replaces the first instance of Find_Text (case insensitive) in the StringScanner buffer with Replace_Text.