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

UTF8PadCenter

Center aligns a string to the specified length.

Declaration

Source position: lazutf8.pas line 139

function UTF8PadCenter(

  const S: string;

  const N: Integer;

  const AUtf8Char: string = #32

):string;

Arguments

S

  

Original string value.

N

  

Desired length for the string (in codepoints).

AUtf8Char

  

UTF-8 codepoint used as a padding character.

Function result

Modified value for the string after center alignment.

Description

UTF8PadCenter is used to center align a string to the specified length (number of codepoints). N indicates the length of the modified string after padding on the left and right with the UTF-8 codepoint in AUtf8Char. The default value for AUtf8Char is #32 ([SPACE]), but can contains any valid UTF-8 codepoint (1 to 4 bytes).


Version 3.2 Generated 2024-02-25 Home