Please enable JavaScript to view this site.

 

str = StrReplace(sFull,sOld,sNew,bAll,bIgnoreCase)

 

This macro function takes a string sFull and replaces occurrences of the string sOld by sNew.

 

•bAll: when this parameter is true, all occurrences of sOld will be replaced, otherwise only the first occurrence will be replaced.

•bIgnoreCase: when this parameter is true the search for occurrences of sOld is case insensitive. So, in that case, a value of 'nasa' for sOld would also find occurrences of 'NASA' and 'Nasa'.

 

Below are some examples of the use of this function.

sResult = StrReplace('Jan, Jan, Feb', 'Jan', 'January', false, false)
// 'January, Jan, Feb'
sResult = StrReplace('Jan, Jan, Feb', 'Jan', 'January', true, false)
// 'January, January, Feb'

See also: PadString, StrReplaceRegex.

 


Topic 110025, last updated on 16-Oct-2026