[Overview][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'LazUTF8' (#lazutils)

UTF8Copy

Copies the specified number of codepoints from the UTF-8-encoded string.

Declaration

Source position: lazutf8.pas line 115

function UTF8Copy(

  const s: string;

  StartCharIndex: PtrInt;

  CharCount: PtrInt

):string;

Arguments

s

  

String with values to copy in the function.

StartCharIndex

  

Initial character position for the copy operation.

CharCount

  

Number of characters (codepoints) to copy in the function.

Function result

String with codepoints copied from the specified source.

Description

UTF8Copy is a String function used copy to UTF-8-encoded values from s starting at the position in StartCharIndex. CharCount specifies the number of multi-byte characters (or codepoints) to include in the return value. The return value is an empty string ('') when s is not a valid UTF-8-encoded string.

UTF8Copy behaves like a substring function.


Version 3.2 Generated 2024-02-25 Home