unit Unit1;<br><br>interface<br><br>uses<br> Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<br> Dialogs, StdCtrls;<br><br>type<br> TForm1 = class(TForm)<br> Edit1: TEdit;<br> Button1: TButton;<br> Edit2: TEdit;<br> procedure Button1Click(Sender: TObject);<br> private<br> { Private declarations }<br> public<br> { Public declarations }<br> end;<br><br>var<br> Form1: TForm1;<br><br>implementation<br><br>{$R *.dfm}<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br>i:integer;<br>begin<br> edit2.Text:='';<br> i:=1;<br> while i<=length(edit1.Text) do<br> begin<br> if not (bytetype(edit1.Text,i)=mbSingleByte) then//如果是双字节<br> begin<br> edit2.Text:=edit2.Text+copy(edit1.Text,i,2);<br> i:=i+2<br> end<br> else<br> i:=i+1;<br> end;<br>end;<br><br>end.<br><br>民工正确<br>6530的也正确