unpackCString

unpackCString(start: Integer): String;

The unpackCString method of the Binary primitive type returns a string extracted from the binary, starting at the position specified by the start parameter and including all characters up to (but not including) the first null character.

The code fragment in the following example shows the use of the unpackCString method.

str := msg.unpackCString(1);

If the null character is not found, the string consists of all characters from the specified start position up to the end of the binary.

Unpacking of the string stops at the first null character. If the C string contains embedded nulls, the returned string therefore represents only that part of the C string up to the first null character.

As the input is assumed to be a binary value of ANSI characters, the returned string is converted to Unicode characters when this method is used in a Unicode JADE system.