replacefirst(
TEXT
,
OLD
,
NEW
)

The replacefirst( function replaces the first occurence of some text with new text.


Parameters

This function has three parameters:

text – is the item of text that you want to search through and possibly replace part of.

old – is the character, word or phrase that you want to search for and replace. This must be the exact character, word, or phrase, including upper or lower case. If this text occurs more than once, only the first occurrence will be replaced.

new – the new character, word or phrase that you want to substitute for the old character word or phrase.


Description

This function replaces the first occurence of some text with new text. If there are multiple occurences of the original text, only the first occurence will be replaced.

replacefirst("red blue red green","red","orange") ☞ orange blue red green
replacefirst("555-1212","5","five") ☞ five55-1212

Note: Unlike the regular replace( function, the replacefirst( function does not allow multiple old and new parameters.


See Also


History

VersionStatusNotes
10.0NewNew in this version.