&27905;&38754;&20083;如何转换为中文
洁面乳怎么转换为中文
洁面乳怎么转换为中文
------解决方案--------------------
function TForm1.ToUnicodeStr(const asUnicodeHex: string): string;
var
i: Integer;
sTemp: string;
begin
for i := 1 to Length(asUnicodeHex) do
begin
if asUnicodeHex[i] = '#' then
begin
sTemp := Copy(asUnicodeHex, i + 1, 5);
sTemp := WideChar(StrToIntDef(sTemp, 0));
Result := Result + sTemp;
end;
end;
end;
------解决方案--------------------
洁面乳怎么转换为中文
------解决方案--------------------
function TForm1.ToUnicodeStr(const asUnicodeHex: string): string;
var
i: Integer;
sTemp: string;
begin
for i := 1 to Length(asUnicodeHex) do
begin
if asUnicodeHex[i] = '#' then
begin
sTemp := Copy(asUnicodeHex, i + 1, 5);
sTemp := WideChar(StrToIntDef(sTemp, 0));
Result := Result + sTemp;
end;
end;
end;
------解决方案--------------------
- Delphi(Pascal) code
procedure TForm1.Button1Click(Sender: TObject); var posX:integer; SourceStr,ResultStr:string; begin SourceStr:='洁面乳'; SourceStr:=StringReplace(SourceStr,'&#','',[rfReplaceAll]); while true do begin posX:=pos(';',SourceStr); ResultStr:=ResultStr+Widechar(StrToInt(Copy(SourceStr,1,posX-1))); delete(SourceStr,1,posX); if SourceStr='' then Break; end; showmessage(ResultStr);//结果是洁面乳? end;