vbNullString to C# conversion issue...

I'm working on a C# project that utilizes an API. The API is expecting to recieve a vbNullString as an input to a function and I have no idea how to send that. How do I convert a C# string to a vbNullString

Answer this question

vbNullString to C# conversion issue...

  • Hokgiarto

    hi,

    string MyVar; <<<<< this is unintialized variable equal to null/nothing

    string MyVar2 = ""; <<<< this is empty string

    hope this helps



  • Greg Guzik

    Nope, that one gave me an error, too. Apparently, string.empty is not equivelent to null.

    Red.


  • dovotowork

    Thankyou. It's strange, I declared two strings and set them to null and that didn't work, but just putting the null value in did work. I would've expected the first to work as well.

    Red.


  • Dave_B

    In VB.NET, vbNullString returns has the same value as Nothing, so in C# you can simply use null.

  • narayank

    How about string.empty
  • vbNullString to C# conversion issue...