一个低级问题,那位大侠可以指教啊。(0分)

阿波

Unregistered / Unconfirmed
GUEST, unregistred user!
用COPY(S,I,C),取出了一EDIT中的值,现有某串数值要和它进进比较,如12ASF345,
如何比较啊。那位老兄教教我。
 
s := Copy(Edit1.Text, 1, 20);
if s = '12ASF345' then
begin
……
end;
 
你想怎么比较呢。可以用POS函数。
FUNCTION POS(SUBSTR:STRING;S:STRING);
检查字符串S中是否有字符串SUBSTR子串。
 
s := Copy(Edit1.Text, 1, 20);
if I = CompareStr('12ASF345', s) then
相等
else
不相等
 
s := Copy(Edit1.Text, 1, 20);
if CompareStr('12ASF345', s)=0 then
相等
else
不相等
 
谢谢各位了。
 
接受答案了.
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
D
回复
0
查看
954
DelphiTeacher的专栏
D
D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
顶部