Search

BUG - VB.NET Replace returns Nothing when an empty string is passed in by MoonNSunM

Closed
as Won't Fix Help for as Won't Fix

1
1
Sign in
to vote
Type: Bug
ID: 89920
Opened: 2/8/2006 12:38:22 PM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
In the .NET framework 1.1 when the Replace function is used in Visual Basic the empty string value passed in is not the value returned. The value returned is Nothing. Nothing and an empty string are two different things. Empty strings are a valid value, in particular when working with values in a dataset.
Details (expand)
Product Language
English
Version
Visual Studio 2005
Category
Data
Operating System
Windows 2000 Professional
Operating System Language
US English
Steps to Reproduce
line of code
strResult = Replace(""," ", "") OR
strResult = Replace(strEmptyStringOnThisDatasetRecord, strSpace, strEmptyString)
Actual Results
returns Nothing rather than returning the empty string.
Expected Results
Returns the string passed in with replacements completed rather than returning "Nothing".
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 5/18/2006 at 3:02 PM
Hi,

Thank you very much for reporting this issue. Unfortunately, VB had this behavior in previous version too and we can't change it due to backward compatibility problem.

Thanks,
VB Development Team.
Posted by Microsoft on 2/8/2006 at 8:54 PM
Thank you for your feedback. We are investigating this issue.

Thank you, VS2005 Product Team.
Sign in to post a workaround.