VirtualString.Replace(String, String, Variable, Variable) Method

Top 

Description

Returns a modified copy of the calling VirtualString in which occurences of stringToReplace have been replaced with replacementString and stores the number of replacements made in replaceCount. When replaceType is "All" every occurence is replaced. When replaceType is "First" or "Last" only the first or last occurence is replaced respectively.

 

Timing Precision Mode

This page describes functionality in millisecond timing precision mode. Millisecond timing precision mode is deprecated and will be removed in a future release. We recommend that you migrate your Mission Plans to nanosecond timing precision mode.

Click here to see the documentation for this object in nanosecond timing precision mode.

 

Method Signature

VirtualString.Replace(

String stringToReplace,


String replacementString,


Variable replaceType,


Variable replaceCount)

 

 

Arguments

stringToReplace


Description:

The string or character to find and replace in the returned String.

 

 

replacementString


Description:

The string or character to use in place of the substrings matched by stringToReplace.

 

 

replaceType


Description:

Specifies whether to replace all, the first, or the last occurences of stringToReplace in the returned String.

Valid Values:

Value

Label

0

All

1

First

2

Last

 

 

 

replaceCount


Description:

Will store the number of replaces that were made.

 

 

 

Return Value

Type:

string

 

 

Returns a modified copy of the calling VirtualString in which occurences of stringToReplace have been replaced with replacementString.

 

Syntax

myString1 = myString2.ToLowercase().Replace(myString3, myString4, myVariable1, myVariable2);

 

 

See also

VirtualString Object

VirtualString.Replace