FORMULA LANGUAGE


@ReplaceSubstring
Example

Replaces specific words or phrases in a string with new words or phrases that you specify. Case sensitive.

Syntax

@ReplaceSubstring( sourceList ; fromList ; toList )

Parameters

sourceList


fromList
toList
Return value

newSourceList


Usage

If more strings are specified in the fromList than the toList, the extra strings in fromList are replaced with the last string in toList. Extra strings in toList are ignored. If no matches are found, @ReplaceSubstring returns the unmodified sourceList.

If a list is specified for fromList, each subsequent list item is scanned against the resulting sourceList, with prior list item substitutions performed.

For example:

@ReplaceSubstring("first";"first":"second";"second":"third")

returns third.

First, @ReplaceSubstring substitutes "second" for "first" from the first list item in fromList. The resulting sourceList is now "second." The function substitutes "third" for "second" from the second list item in fromList.

Tip Use @ReplaceSubString to remove carriage returns from text by replacing them with " " or "."

Language cross-reference

Mid statement of LotusScript language

Example
See Also