FindReplaceInString Method

Finds the first occurrence of a string within a specified string and replaces it with another.

Syntax

object.FindReplaceInString pbstrTargetString, lStartChar, bstrFindString, bstrReplacementString, lFlags, plFirstChar, plCharCount, pbstrResultString, pbSuccess

Properties

The FindReplaceInString method syntax has these parts:

Part

Description

object

An object expression that evaluates to an object in the Applies To list.

pbstrTargetString

String. The name of the event.

lStartChar

String. The code to be written to the event in the form of strings.

bstrFindString

String. The string to search for.

bstrReplacementString

String. The string to be substituted for the first occurrence of the find string.

lFlags

Long. Search modifiers.  

Valid entries:
0-15 in any of the following combinations:
0 - No modifiers
1 - Match Case
2 - Whole Word Only
4 - Data Source Only
8 - Include Scripts

plFirstChar

Long. Returns a one-based index of the first character in the target string which was involved in the match with the find string.

plCharCount

Long. Returns the number of characters in the target string which were involved in the match of the find string.

pbstrResultString

String. Returns the new string with the specified replacement.

pbSuccess

Boolean. Returns True if the operation succeeded, False otherwise.

 

Example

Applies To