StringReplace - method of the Pm object

The method searches for each occurrence of the sSearch text in the sValue string, replaces the sSearch text by the sReplace value and returns the result.
String StringReplace(String sValue, String sSearch, String sReplace, [String sParams])
sValue(String) Source string in which possibly found the sSearch value will be replaced by the sReplace value.
sSearch(String) Text in the sValue string that has to be replaced by the sReplace value.
sReplace(String) Value by which the sSearch item in the sValue string has to be replaced.
sParams[optional] (String) Additional parameters.
count:n; - Specifies the number of replacements.
count:-1; (default) - replace all
count:n; - n - number of replacement occurrence
start:n; - Specifies the starting position of replacement.
start:0; (default) - the replacemenet start is from beginning of the source text
start:n; - n - Character position in the source string defining the start of the replacemenet (zero-based index)
This method is functional also in Macro expression $.expr and in the onDraw event of the PmgCanvas object.
This method is also functional in Web panels.
JavaScriptVBScriptSelect and copy to clipboard

var sString = Pm.StringReplace("XXpXXPXXp", "p", "Y");   // sString contains "XXYXXPXXY"

Pm8.02.01: Created
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
- Pm
- Abs
- Cos
- E
- Exp
- LN2
- PI
- Pow
- Sin
- StringReplace
- Tan
© MICROSYS, spol. s r.o.