* Add unicode AnsiLastChar overload

This commit is contained in:
Michaël Van Canneyt 2023-11-14 10:26:49 +01:00
parent ea63bfb32f
commit 45021498cf
2 changed files with 9 additions and 0 deletions

View File

@ -546,6 +546,14 @@ begin
Dec(Result);
end ;
function AnsiLastChar(const S: UnicodeString): PWideChar;
begin
//!! No multibyte yet, so we return the last one.
result:=StrEnd(PWideChar(Pointer(S))); // strend checks for nil
Dec(Result);
end ;
function AnsiStrLastChar(Str: PAnsiChar): PAnsiChar;
begin
//!! No multibyte yet, so we return the last one.

View File

@ -101,6 +101,7 @@ function AnsiStrLIComp(S1, S2: PAnsiChar; MaxLen: SizeUInt): Integer;{$ifdef SYS
function AnsiStrLower(Str: PAnsiChar): PAnsiChar;{$ifdef SYSUTILSINLINE}inline;{$endif}
function AnsiStrUpper(Str: PAnsiChar): PAnsiChar;{$ifdef SYSUTILSINLINE}inline;{$endif}
function AnsiLastChar(const S: AnsiString): PAnsiChar;
function AnsiLastChar(const S: UnicodeString): PWideChar;
function AnsiStrLastChar(Str: PAnsiChar): PAnsiChar;
function Trim(const S: ansistring): ansistring;