Promotic

StringReplace - method of the Pm object

Description:
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.
Syntax:
String StringReplace(String sValue, String sSearch, String sReplace, [String sParams])
Parameters:
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)
Note:
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.
Example:
JavaScriptVBScriptSelect and copy to clipboard

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

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

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