Results 1 to 6 of 6

Thread: [RESOLVED] the equivalent for ControlChars.NullChar in C# ?

  1. #1

    Thread Starter
    PowerPoster motil's Avatar
    Join Date
    Apr 2009
    Location
    Tel Aviv, Israel
    Posts
    2,143

    Resolved [RESOLVED] the equivalent for ControlChars.NullChar in C# ?

    i'm trying to convert a program from vb.net to C#
    but i can't find the equivalent for ControlChars.NullChar in C#
    i tried '\0' but it does not give me the same result.

    can anyone help please?
    * Rate It If you Like it

    __________________________________________________________________________________________

    "Programming is like sex: one mistake and you’re providing support for a lifetime."

    Get last SQL insert ID

  2. #2
    Fanatic Member amrita's Avatar
    Join Date
    Jan 2007
    Location
    Orissa,India
    Posts
    888

    Re: the equivalent for ControlChars.NullChar in C# ?

    What is the exact line to be replaced ?
    thanks
    amrita

  3. #3

  4. #4

    Thread Starter
    PowerPoster motil's Avatar
    Join Date
    Apr 2009
    Location
    Tel Aviv, Israel
    Posts
    2,143

    Re: the equivalent for ControlChars.NullChar in C# ?

    yes i tried ConvertToChar(0) and also Convert.ToChar(0x0)
    but it seems that i might wrong and it works after all, I'm still working on this and will update the thread when done.

    thanks for the help guys.
    * Rate It If you Like it

    __________________________________________________________________________________________

    "Programming is like sex: one mistake and you’re providing support for a lifetime."

    Get last SQL insert ID

  5. #5
    Fanatic Member
    Join Date
    Jan 2006
    Posts
    710

    Re: the equivalent for ControlChars.NullChar in C# ?

    '\0' is indeed the equivalent.
    The issue is more likely related to the fact that VB allows you to interchange characters and strings (e.g., use characters where a string is expected and strings where a character is expected), while C# does not.
    David Anton
    Convert between VB, C#, C++, & Java
    www.tangiblesoftwaresolutions.com

  6. #6

    Thread Starter
    PowerPoster motil's Avatar
    Join Date
    Apr 2009
    Location
    Tel Aviv, Israel
    Posts
    2,143

    Re: the equivalent for ControlChars.NullChar in C# ?

    Yea, sorry guys the problem was not with the null char at all i just thought it is.

    thanks again for the replay's !
    * Rate It If you Like it

    __________________________________________________________________________________________

    "Programming is like sex: one mistake and you’re providing support for a lifetime."

    Get last SQL insert ID

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width