[Overview][Procedures and functions][Index] Reference for unit 'LazUTF16' (#lazutils)

UTF16Pos

Pos implemented for UTF-16-encoded values.

Declaration

Source position: lazutf16.pas line 43

function UTF16Pos(

  const SearchForText: UnicodeString;

  const SearchInText: UnicodeString;

  StartPos: PtrInt = 1

):PtrInt;

Arguments

SearchForText

  

UTF-16-encoded value to locate in SearchInText.

SearchInText

  

UTF-16-encoded value searched in the routine.

StartPos

  

Optional starting position (in UTF-16 code points, not in words).

Function result

Character index where the SearchForText starts in SearchInText, or 0 when not found.

Description

UTF16Pos is a PtrInt function used to get the character index in SearchInText where the value in SearchForText is located. StartPos allows the search to begin at a specific character (code point).

The return value is the 1-based UTF-16 character index where the SearchForText starts in SearchInText, or 0 when not found.


Version 3.2 Generated 2024-02-25 Home