delphi从字符串中取出数字


本文整理自网络,侵删。

 type
TCharSet = set of Char;

function StripNonConforming(const S: string;
const ValidChars: TCharSet): string;
var
DestI: Integer;
SourceI: Integer;
begin
SetLength(Result, Length(S));
DestI := 0;
for SourceI := 1 to Length(S) do
if S[SourceI] in ValidChars then
begin
Inc(DestI);
Result[DestI] := S[SourceI]
end;
SetLength(Result, DestI)
end;

function StripNonNumeric(const S: string): string;
begin
Result := StripNonConforming(S, ['0'..'9'])
end;

相关阅读 >>

Delphi 获得用android应用程序触摸到的位置(坐标)的方法

Delphi unigui程序部署到服务器

Delphi 不重启不注销不关explorer刷新注册表

Delphi debug release区别是什么?

Delphi hook 指定程序窗体和控件的 wndproc

Delphi 获取android包名称

Delphi tms web core 通过url 传递参数

使用Delphi启动和关闭外部应用程序

Delphi截获和干扰窗体最小化�p最大化和关闭消息

Delphi 取得文件版本

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...