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.

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.2.2UpdatedIf the value to be replaced appears multiple times in the array, all occurences will be replaced. In previous versions, only the first occurence would be replaced.
10.0UpdatedCarried over from Panorama 6.0 but more than one character is now allowed for use as the separator parameter.