Replace function bug?

  • Thread starter Thread starter DirectorDobek
  • Start date Start date
D

DirectorDobek

I am using VB .net on an asp .net page

When executing this code:
Dim x As String = ""
x = Replace(x, "xxx", "yyy")
x = x.ToUpper()
I get "Object reference not set to an instance of an
object" error because the Replace() function returns
nothing. Acording to the documentation it should return a
Zero-length string ("")
Is it a bug? Any ideas?
 
Hello,

DirectorDobek said:
I am using VB .net on an asp .net page

When executing this code:
Dim x As String = ""
x = Replace(x, "xxx", "yyy")
x = x.ToUpper()
I get "Object reference not set to an instance of an
object" error because the Replace() function returns
nothing. Acording to the documentation it should return a
Zero-length string ("")
Is it a bug? Any ideas?

IMO this is a bug.

http://groups.google.de/groups?&selm=#[email protected]

HTH,
Herfried K. Wagner
 
Back
Top