Click or drag to resize

StringConversionConvertToLengthEncoded Method (String, Int32)

Convert a string to an array of bytes where the first byte contains the string length. Only works with 1 byte character encoded strings (eg ASCII).

Namespace:  Demo3D.PLC
Assembly:  PLC (in PLC.dll) Version: 15.0.2.11458
Syntax
C#
public static byte[] ConvertToLengthEncoded(
	string str,
	int maxLength
)

Parameters

str
Type: SystemString
String to convert.
maxLength
Type: SystemInt32
Maximum length of the string to write.

Return Value

Type: Byte
Encoded byte array.
See Also