[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'sysutils' (#rtl)

TEncoding.GetString

Return a string based on an array of bytes

Declaration

Source position: sysencodingh.inc line 89

public function TEncoding.GetString(

  const Bytes: TBytes

):UnicodeString; overload;

function TEncoding.GetString(

  const Bytes: TBytes;

  ByteIndex: Integer;

  ByteCount: Integer

):UnicodeString; overload;

Description

GetString will return a Unicode string, created from the bytes in the Bytes array. The bytes array will be interpreted according to the encoding which the TEncoding represents.

If ByteIndex and ByteCount are specified, only the ByteCount bytes starting at position ByteIndex will be converted.

Errors

In case of invalid bytes, an EEncodingError exception may be raised.


Documentation generated on: May 14 2021