Replace - function of language VBScript

Returns a string in which a specified substring has been replaced with another substring a specified number of times.

For the purposes of the PROMOTIC system, it is more usefull to use the method: Pm.StringReplace.

String Replace(String expression, String find, String replacewith, [Integer start], [Integer count], [Integer compare])
s = Replace(expression, find, replacewith[, start[, count[, compare]]])
expression(String) Text string containing substring to replace
find(String) Substring being searched for
replacewith(String) Replacement substring
start[optional] (Integer) Position within expression where substring search is to begin. If not set, then 1 is assumed.
count[optional] (Integer) Specifies the number of substring substitutions to perform. If not set, then the value is -1, which means make all possible substitutions.
compare[optional] (Integer) Numeric value indicating the kind of comparison to use when evaluating substrings. If not set, then a binary comparison is performed.
vbBinaryCompare - perform a binary comparison
vbTextCompare - perform a textual comparison
Return Values:
Text string, with substitutions made, that begins at the position specified by "start" and and concludes at the end of the "expression" string. It is not a copy of the original string from "start" to finish. Special cases:
empty string ("") - if "expression" is empty string or if "start" > Len("expression").
copy of "expression" - if "find" is empty string or if "count" is 0.
Copy of expression with all occurrences of "find" removed - if "replacewith" is empty string.
VBScriptSelect and copy to clipboard

Dim sString
'a binary comparison starting at the beginning of the string. Returns "XXYXXPXXY".
sString = Replace("XXpXXPXXp", "p", "Y")
'a textual comparison starting at position 3. Returns "YXXYXXY".
sString = Replace("XXpXXPXXp", "p", "Y", 3, -1, 1)
PROMOTIC 9.0.6 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice