diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2009-10-15 17:06:07 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2009-10-15 17:06:07 +0200 |
commit | 1ebef6d3a58653ef310796c52854f5e641111681 (patch) | |
tree | aecf6ac3fef1f10534d779e34f945bbc42ea21e4 /components | |
parent | 3ac80ccd0a8b694123a768f3a05682830f806443 (diff) | |
download | fpGUI-1ebef6d3a58653ef310796c52854f5e641111681.tar.xz |
New string function added, which is used by DocView.
Signed-off-by: Graeme Geldenhuys <graeme@mastermaths.co.za>
Diffstat (limited to 'components')
-rw-r--r-- | components/richtext/ACLStringUtility.pas | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/components/richtext/ACLStringUtility.pas b/components/richtext/ACLStringUtility.pas index 33c542d4..c3b222df 100644 --- a/components/richtext/ACLStringUtility.pas +++ b/components/richtext/ACLStringUtility.pas @@ -325,6 +325,10 @@ function MatchFlagParam( const Param: string; const Flag: string ): boolean; // this is case INsensitive function StrStartsWithIgnoringCase(const aReceiver: String; const aStartString: String): Boolean; +// returns true if the String ends with the provided one +// this is case INsensitive +function StrEndsWithIgnoringCase(const aReceiver: String; const anEndString: String): Boolean; + function StrIsEmptyOrSpaces(const AText: string): boolean; implementation @@ -1665,6 +1669,34 @@ begin result := true; end; +Function StrEndsWithIgnoringCase(const aReceiver: String; const anEndString: String): Boolean; +Var + tmpStringPos : Longint; + tmpMatchPos : Longint; +Begin + tmpStringPos := length(aReceiver); + tmpMatchPos := length(anEndString); + + if tmpMatchPos > tmpStringPos then + begin + result := false; + exit; + end; + + while tmpMatchPos > 0 do + begin + if upcase(aReceiver[tmpStringPos]) <> upcase(anEndString[tmpMatchPos]) then + begin + result := false; + exit; + end; + dec(tmpMatchPos); + dec(tmpStringPos); + end; + + result := true; +end; + function StrIsEmptyOrSpaces(const AText: string): boolean; begin Result := Trim(AText) = ''; |