Why doesn't a replacement return anything to an empty string?

Replace("",vbLf, "") 

Show drawing.

He must be back "

Not. It does not return anything.

Just put the code in vb.net

I think he should return. "Replace all vbLF events with" ". Since the original string is" ", it just does not replace anything, and we returned" "

\ Not. We have not returned anything.

+4
source share
2 answers

You are using the string functions of Visual Basic, not .Net. The Visual Basic work environment typically evaluates Nothing as an empty string ("").

+2
source

In the second source post, VB.net should not return NOTHING using the REPLACE function. However, if your replacement occurs to return Nothing, if the expression is an empty string.

+1
source

Source: https://habr.com/ru/post/1398742/


All Articles