在DELPHI中如何截取身份证中的出生年月日

来源:百度知道 编辑:UC知道 时间:2024/06/08 08:42:03
就是去掉身份证中前6位和后4位,只留下出生的年月日.这个该如何截取?
BC别在我这乱来,想让我中木马,做梦吧.

var
Code, Birthday: string;
begin
code := '212343194103121234';//或是15位的,下面可以处理一下
if lengh(code) = 15 then
birthday := copy(code, 7, 6)
else
birthday := copy(code, 7, 8);
showmessage(birthday);
end;