Name
Replace Function — Microsoft.VisualBasic.Strings
Synopsis
Replace(expression, find, replace
[,start
[, _count
[,compare
]]])
expression
required; StringThe complete string containing the substring to be replaced
find
required; StringThe substring to be found by the function
replace
required; StringThe new substring to replace
find
inexpression
start
optional; LongThe character position in
expression
at which the search forfind
beginscount
optional; LongThe number of instances of
find
to replacecompare
optional;CompareMethod
constantThe method used to compare
find
withexpression
; its value can beCompareMethod.Binary
(for case-sensitive comparison) orCompareMethod.Text
(for case-insensitive comparison)
Return Value
The return value from Replace depends on the parameters you specify in the argument list, as the following table shows:
If |
Return value |
|
Zero-length string (“”) |
|
Copy of |
|
Copy of |
|
Zero-length string (“”) |
|
Copy of |
Description
Replaces a given number of instances of a specified substring in another string.
Get VB.NET Language Pocket Reference now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.