本文整理自网络,侵删。
function EndStr(const S: String; const Count: Integer): String;var I: Integer; Index: Integer;begin Result := ''; for I := 1 to Count do begin Index := Length(S)-I+1; if Index > 0 then Result := S[Index] + Result; end;end;
procedure TForm1.FormCreate(Sender: TObject);beginCaption:=EndStr('12345678910',5); //结果78910end;
相关阅读 >>
Delphi 全局变量 hinstance 到底是在什么时候赋值的?
Delphi tokyo 版本 twebbrowser 的一个问题(bug?)
winapi 字符及字符串函数(5): ischaralpha - 是否是个字母
更多相关阅读请进入《Delphi》频道 >>