您的位置:首页 > 编程语言 > Delphi

delphi技巧--分离汉字和英文字母

2020-02-17 06:40 453 查看

const 
  s:widestring='k你asdfdsf好d吗?';
var
  i:integer;
  y,h:string;
begin
  while Length(s)<>0 do
    begin
      if Length(s[i])=Length(string(s[i])) then
        y:=y+s[i]
      else h:=h+s[i];
      s:=copy(s,2,length(s));
    end;
  edit1.Text:=y;
  edit2.Text:=h;
end;

转载于:https://www.cnblogs.com/duhai_lee/archive/2005/03/30/128538.html

  • 点赞
  • 收藏
  • 分享
  • 文章举报
dianye4573 发布了0 篇原创文章 · 获赞 0 · 访问量 154 私信 关注
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: