H
Harry F. Harrison
In VS 2003, If an empty string is passed into the 1st parameter, the Replace
function returns Nothing.
Example:
Dim strResults As String = ""
strResults = Microsoft.VisualBasic.Replace("", "AND", "And", , ,
CompareMethod.Binary)
looking at strResults in the debugger shows it having a value of nothing
after executing the Replace function.
The documentation specifically says that it should return an empty string.
Return Values
Replace returns the following values:
If Replace returns
Expression is zero-length Zero-length string ("")
Find is zero-length Copy of Expression
Replace is zero-length Copy of Expression with no occurrences of Find
Start is greater than length of expression Zero-length string
Count is 0 Copy of Expression
function returns Nothing.
Example:
Dim strResults As String = ""
strResults = Microsoft.VisualBasic.Replace("", "AND", "And", , ,
CompareMethod.Binary)
looking at strResults in the debugger shows it having a value of nothing
after executing the Replace function.
The documentation specifically says that it should return an empty string.
Return Values
Replace returns the following values:
If Replace returns
Expression is zero-length Zero-length string ("")
Find is zero-length Copy of Expression
Replace is zero-length Copy of Expression with no occurrences of Find
Start is greater than length of expression Zero-length string
Count is 0 Copy of Expression