fbpx

Method Common.ReplaceSubString

Returns a new string in which all occurrences of a specified string in the current instance are replaced with another specified string

Usage

Function ZAP.Common.ReplaceSubString ( 
	String Str,
	String OldValue,
	String NewValue
)

Parameters

Str

Type: String

Current String

OldValue

Type: String

The string to be replaced

NewValue

Type: String

The string to replace all occurrences of oldValue

Returns

A string that is equivalent to the current string except that all instances of oldValue are replaced with newValue. If oldValue is not found in the current instance, the method returns the current instance unchanged

Example

VBScript

newString = Zap.Common.ReplaceSubString("oldString", "old", "new")

JavaScript

var newString = Zap.Common.ReplaceSubString("oldString", "old", "new");

Documentation Categories

ZAPTEST

FARM

LOAD

Virtual Expert

ZAPTEST

ZAPTEST Logo