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

ZAP Utility step

...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

Script-Less next step

ZAP Utility

ZAP Utility step

...ReplaceSubString

oldString

old

new

newString

Contact Us

1425 Market Blvd Suite 530-230

Roswell, GA 30076, USA

(800) 795-3552