common, namespace, replace, substring, substr, string, str, scriptless, script-less, scripted, step, view, stepview

Method Zap.Common.ReplaceSubString

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

Watch this video to learn how to use this method

Have a problem with playback?

Usage

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

ZAP Utility

...ReplaceSubString

oldString

old

new

output

Str

OldValue

NewValue

Output Parameter

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");

Comment

Replace "old" substrings to "new" and save it to variable parameter

ZAP Utility

...ReplaceSubString

oldString

old

new

newString

Contact Us

Tower Place 100

3340 Peachtree Rd NE #1800 

Atlanta, GA 30326 USA

(404) 814-5227