|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Microsoft.VisualBasic.Replace bugfunction 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
Show quote
Hide quote
"Harry F. Harrison" <harry***@hotmail.com> schrieb: Yes, this is a bug in the implementation. Unfortunately Microsoft decided > 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. to change the method specification instead of fixing the implementation in VB 2005: Check out this discussion: <URL:http://groups.google.de/group/microsoft.public.dotnet.languages.vb/browse_frm/thread/41cbc41c1c2331ac> -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
You're good if you can answer this one.....
for each on multiple collections Problem with access database, and VB .NET Office application object problem Microsoft Visual Studio 2005 Tools for Applications Changing Printer's default paper Extracting icon from file: most efficient method? Q: GetChildRows Parse bookmarks in a word document Does a menu item lose dataset information? |
|||||||||||||||||||||||