Xbasic

STRITRAN_MULTI Function

Syntax

Output_String as C = STRITRAN_MULTI(C character,C substrings,C replacements)

Arguments

Output_String

The character string produced by the replacement operation.

character

The character string to search.

substrings

The string to find in the character string.

replacements

Default = "" (NULL). The string that replaces the substring.

Description

Replaces occurrences of strings in one cr-lf list with strings in another cr-lf list - compare is case insensitive.

Discussion

STRTIRAN_MULTI() is similar to STRITRAN() , except that Alpha Anywhere performs multiple search and replace operations on the character string, one for each row in substrings. substrings is a CR-LF delimited list of words to search for. Replacements is a CR-LF delimited string of replacement words. The first line in replacements is used as the replacement for the first line of Find_Strings, and so on. STRTIRAN_MULTI() is not case sensitive.

Example 

Assume that substrings contains the following list of words:

He
sold
cars
businesspeople

Assume that replacements contains the following list of words:

She
leased
trucks
farmers

Assume that character string to search contains "He sold cars to businesspeople in California"

stritran_multi(Input _ String, Find_Strings, Replacement_Strings) -> "She leased trucks to farmers in California"

See Also