• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 328
  • Last Modified:

what do you mean by a null terminated string

Hi Experts,

What do you mean by a null terminated string and how do you pass it in VB.NET.
Raju Srivatsavaye
Raju Srivatsavaye
1 Solution
Hello, srivatsavaye,

A null terminated string is one that ends with an Ascii "Null" character.  (It is used quite a bit in C programming.)  You can add a null in VB.Net by using the Chr function.  E.g.

        Dim NullTermString As String = "ABCD" & Chr(0)

You would probably be passing this to some unmanaged routine.  In this case, use the <MarshalAs(UnmanagedType.LPStr)> attribute when you declare the parameter to the routine.


Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now