unit strutils

Various string handling routines

author: Tomasz Biela (Tebe)


https://www.freepascal.org/docs-html/rtl/strutils/index-5.html

Interface:

name:description:
AddChar

function AddChar(C: Char; var S: string; N: Byte): ^string;


AddChar adds characters (C) to the left of S till the length N is reached, and returns the resulting string. If the length of S is already equal to or larger than N, then no characters are added. The resulting string can be thought of as a right-aligned version of S, with length N.
    parameters:
  • C - Char to be added
  • S - The string to be treated
  • N - The minimal length the string should have
AddCharR

function AddCharR(C: Char; var S: string; N: Byte): ^string;


AddCharR adds characters (C) to the right of S till the length N is reached, and returns the resulting string. If the length of S is already equal to or larger than N, then no characters are added. The resulting string can be thought of as a left-aligned version of S, with length N .
    parameters:
  • C - Char to be added
  • S - The string to be treated
  • N - The minimal length the string should have
PadLeft

function PadLeft(var S: string; N: Byte): ^string;


Add spaces to the left of a string till a certain length is reached.
    parameters:
  • S - String to pad
  • N - Minimal length of the resulting string.
PadRight

function PadRight(var S: string; N: Byte): ^string;


Add spaces to the right of a string till a certain length is reached.
    parameters:
  • S - String to pad
  • N - Minimal length of the resulting string.