arrayreplacevalue(
ARRAY
,
OLDVALUE
,
NEWVALUE
,
SEPARATOR
)

The arrayreplacevalue( function changes array elements that match a specified value.


Parameters

This function has four parameters:

array – the original text array (see Text Arrays).

oldvalue – the value of the item (or items) that you want to replace. This must be an exact match, including upper and lower case.

newvalue – the new value of the item

separator – the separator character or characters for this array.


Description

This function replaces any array elements that match the oldvalue parameter with the newvalue parameter. This must be an exact match, including upper and lower case. If the value occurs multiple times in the array, every occurence of the value will be replaced, with one exception: if the value occurs in two consecutive array elements, only the first occurence will be replaced.

arrayreplacevalue("a/b/c/d","b","x","/") ☞ a/x/c/d
arrayreplacevalue("red,green,blue","green","gold",",") ☞ red,gold,blue

See Text Arrays for more information about arrays.

Note: This function is equivalent to:

replace(thesep+thearray+thesep,thesep+oldvalue+thesep,thesep+newvalue+thesep)[2,-2]

See Also


History

VersionStatusNotes
10.0UpdatedCarried over from Panorama 6.0 but more than one character is now allowed for use as the separator parameter.