Important This documentation space contains information about PATROL Agents when deployed in a TrueSight Operations Management environment. If you are a BMC Helix Operations Management user, see PATROL Agent 21.3 for BMC Helix Operations Management.

replace()


Replace a specified string in text with a specified replacement string.

Syntax

replace(text,str,replacement_str)

Parameter

Parameter

Definition

text

original text

str

text string to be found in text

replacement_str

text string to replace str that is found in text

Description

Use the replace() function instead of PSL common string manipulation techniques. All occurrences of str in text are replaced with replacement_str, and the result is returned.

Example

The following example demonstrates the replace() function:

#This example replaces the string "Hello there" with Hello world
new_text = replace("Hello there","there","world");
printf("%s",new_text);

The example above produces the following output:

Hello world

 

 

 

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*