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

UTF8Delete

Deletes characters (or codepoints) in a UTF-8-encoded string.

Declaration

Source position: lazutf8.pas line 116

procedure UTF8Delete(

  var s: Utf8String;

  StartCharIndex: PtrInt;

  CharCount: PtrInt

);

procedure UTF8Delete(

  var s: string;

  StartCharIndex: PtrInt;

  CharCount: PtrInt

);

Arguments

s

  

String with values to delete in the procedure.

StartCharIndex

  

Initial character position where values will be deleted.

CharCount

  

Number of characters (or codepoints) to remove in the procedure.

Arguments

s

  

String with values to delete in the procedure.

StartCharIndex

  

Initial character position where values will be deleted.

CharCount

  

Number of characters (or codepoints) to remove in the procedure.

Description

UTF8Delete is an overloaded procedure used to delete characters (or codepoints) in a UTF-8-encoded string starting at a given position.

StartCharIndex contains the character position in s where values will be removed. StartCharIndex refers to codepoints and not individual byte or character values. A single character can be expressed as 1-4 byte values in UTF-8 encoding. CharCount indicates the number of codepoints to remove in the function.

The value in s is updated directly in the function.

An overloaded variant of the procedure is provided for platforms where the Win1252 code page is used. On these platforms, raw byte values values in s are converted to the UTF-8 code page prior to performing the delete operation.


Version 3.2 Generated 2024-02-25 Home