Strings

Functions

Capitalize

function Capitalize(str : string) : string;

CompressString

function CompressString(const Str : string) : string;

DecompressString

function DecompressString(const Compressed : string) : string;

Base64Encode

function Base64Encode(const str : string) : string;

Base64Decode

function Base64Decode(const str : string) : string;

Format

function Format(const fmt : string;const args : array of const) : string;

ToStr

function ToStr(x) : string;

StringMatch

function StringMatch(checkCompare, goalCompare: string): extended;

Uses levenshtein distance to work out the match % of the two strings.

Between

function Between(s1, s2, str: string): string;

MultiBetween

function MultiBetween(str, s1, s2: string): TStringArray;

Splits a string into an array of strings by giving it an begin and an end tag. Useful for data reading

IntToStr

function IntToStr(value: Integer): String;

FloatToStr

function FloatToStr(value: Extended): String;

BoolToStr

function BoolToStr(value: Boolean): String;

StrToInt

function StrToInt(value: String): Integer;

StrToIntDef

function StrToIntDef(value: String; default: Integer): Integer;

StrToFloat

function StrToFloat(value: String): Extended;

StrToFloatDef

function StrToFloatDef(value: String; default: Extended): Extended;

StrToBool

function StrToBool(value: String): Boolean;

StrToBoolDef

function StrToBoolDef(value: String; default: Boolean): Boolean;

ExtractFromStr

function ExtractFromStr( Str : string; Extract : StrExtr) : string;

Replace

function Replace(Text, FindStr, ReplaceStr: string; Flags: TReplaceFlags): string;

ReplaceWrap

function ReplaceWrap(Text, FindStr, ReplaceStr: string; Flags: TReplaceFlags): string;

Implode

function Implode(Glue: string; Pieces: TStringArray): string;

Explode

function Explode(del, str: string): TStringArray;

ExplodeWrap

procedure ExplodeWrap(del, str: string; var res : TStringArray);

Padl

function Padl(s: String; i: longInt): String;

Padz

function Padz(s: String; i: longInt): String;

Padr

function Padr(s: String; i: longInt): String;

ExecRegExpr

function ExecRegExpr( const RegExpr, InputStr : String) : boolean;

SplitRegExpr

procedure SplitRegExpr( const RegExpr, InputStr : String; Pieces : TStrings);

ReplaceRegExpr

function ReplaceRegExpr( const RegExpr, InputStr, ReplaceStr : String; UseSubstitution : boolean) : String;

PosEx

function PosEx(needle, haystack: String; offset: integer): integer;

IsArrInStr

function IsArrInStr(strArr: TStringArray; s: string): boolean;

Returns true if any of the indexes in TStringArray StrArr is found in string s

IsStrInArr

function IsStrInArr(const s: string; const UsePos: Boolean; const arr: TstringArray): Boolean

LevDistance

function LevDistance(src, target: string): Integer

NormLevDistance

function NormLevDistance(src, target: string): Extended

PosMulti

function PosMulti(const SubStr: string; Text: string): TIntegerArray