ReplaceWildcard

Top  Previous  Next

function ReplaceWildcard(sSource As String, sSearchWildcard As String, sReplaceStr As String) As String

 

Returns a string in which a specified substring (defined with a Wildcard) has been replaced with another substring. This function replaces all found matches.

 

sSearchWildcard is a Wildcard with a start text, an asterisk and an end text with the syntax:

 

StartText*EndText

 

ReplaceWildcard is case-sensitive.

 

Parameters

 

sSource ... String expression containing substring to replace.
sSearchWildcard ... Wildcard Expression being searched for.
sReplaceStr ... Replacement substring.

 

Example:

Dim s

 

= "<table><tr><td>354</td></tr></table>"

= ReplaceWildcard(s, "</td>*</td>", "</td>-</td>")

' returns s = "<table><tr><td>-</td></tr></table>"




Translate document: