有一字符串'1 2 3 4 5 6 7'或'1,2,3,4 ,5 , 6 ,'或'1+2+3 + 4+ 5'
如何从其中提取每一个数字并放在一个数组中
如何从其中提取每一个数字并放在一个数组中
解决方案 »
- 谁有《常用多媒体文件格式与压缩标准解析》这本书啊
- Delphi2009使用VCSKIN的朋友进来下
- 大家帮看一下,这个是用什么控件做的?
- 求助一个问题,急!!!
- win api 函数的使用在线等
- 谁知道哪里有下载delphi6或delphi7的呢?
- BDE exception edbehgineerror in module bdeadmin.exe at 00054F92.could not fined
- delphi动态连接mysql问题,100奉送
- 怎样在运行期添加或改变Tspeedbutton的图标(glyph属性)?
- 哪里有ftp的工具下载
- 请各位高手帮忙,关于用DELPHI和MYSQL数据厍开发网站的问题
- DELPHI 与MYSQL的问题
var
a,s:sting;
i:integer;
begin
s;='1+2+3'
for i:=1 to length(s) to
if s[i] in ['0'..'9']
then a:=a+s[i];end;数组的道理一样,给分吧,后面的别补充了,已经很详细了,不行给我发消息
只需一条命令.字符串可以看成是字符数组, 也分给我一半分吧, 后面的别补充了, 现在是真的很详细了,不行给我发消息
s,t: string;
i: integer;
begin
s := '123 456 7 8 9';
t := ''; for i:=1 to length(s) do
if s[i] in ['0'..'9'] then
begin
t := t + s[i]
end
else if t <> '' then
begin
// add t to array here
t := '';
end;
if t <> '' then
begin
// add last t to array here
end;
end;