Unit MStrTool

Classes

Functions

Str2Float - * Str2Float * * Str2Float can be used as a substitute for the standard StrToFloat function.
Str2Int - * Str2Int * * Str2Int can be used as a substitute for the standard StrToInt function.
StripQuoteChars - * StripQuoteChars * * will strip the given char from the start and end of the string, * but only if it is at both extremities.
StripRChar - * StripRChar * * Will strip the given char from the end of the string if it is there.
StrLTrim - * StrLTrim, StrRTrim, StrTrim * * These FUNCTIONS will trim leading whitespaces, trailing * whitespaces, or both.
StrMerge - * StrMerge * * StrMerge will take all strings in the list and place these * in a single string, separated by the 'sep' character.
StrParse - * StrParse * * This procedure parses the given string s and stores it as * separate strings in the given TStrings object.
StrRTrim -
StrTrim -

Types

Constants

whitespaces

Variables


Functions


function Str2Float( s: String): extended;

* Str2Float * * Str2Float can be used as a substitute for the standard StrToFloat function. * The StrToFloat function throws an exeption if the string property contains * a non-numeric character like spaces, or if the decimal separator is * a comma where it should be a dot or vice versa. * This function takes care of leading and trailing * backspaces and of wrong kind of decinal separator. * The function returns 0 when exceptions occur.

function Str2Int( s: string): longint;

* Str2Int * * Str2Int can be used as a substitute for the standard StrToInt function. * The StrToInt function throws an exeption if the Text property contains * a non-numeric character like spaces. * This function returns 0 when this exception occurs.

procedure StripQuoteChars( var destination: string; strip : char);

* StripQuoteChars * * will strip the given char from the start and end of the string, * but only if it is at both extremities.

procedure StripRChar( var destination: string; strip : char);

* StripRChar * * Will strip the given char from the end of the string if it is there.

function StrLTrim( s: string): string;

* StrLTrim, StrRTrim, StrTrim * * These FUNCTIONS will trim leading whitespaces, trailing * whitespaces, or both.

procedure StrMerge( list : TStringList; var s: string; sep : char);

* StrMerge * * StrMerge will take all strings in the list and place these * in a single string, separated by the 'sep' character. * There is no 'sep' char after the last subtring.

procedure StrParse( var list : TStringList; s: string; sep : char);

* StrParse * * This procedure parses the given string s and stores it as * separate strings in the given TStrings object. Each new * string is inserted at it's sequential position. * The input string is assumed to be made up out of sequences * of any characters, separated by the char given in 'sep'. * A 'sep' char following the last substring is optional.

function StrRTrim( s: string): string;


function StrTrim( s: string): string;


Types


Constants

whitespaces = [#8, #10, #12, #13, ' ']

Renamed from StrTools.pas 6/20/1998 Paul Rice to avoid conflicts with others' work.

Variables