读书人

这段代码什么意思解决方法

发布时间: 2012-03-09 16:54:57 作者: rapoo

这段代码什么意思

Delphi(Pascal) code
function STR_DisplayRawStringHZ(Value: string): string;var   i: Integer;begin  Result:='';  for i:=1 to Length(Value) do begin      if Value[i]>=#$20 then begin         Result:=Result+Value[i];      end else begin         Result:=Result+'$'+Format('%2.2X',[Byte(Value[i])]);      end;  end;end;

其中#$20 和 format('%2.2X',[Byte(value[i])]) 分别是什么意思
还有就是format('%2.2X',[Byte(value[i])]) 用c#该怎么写

[解决办法]
#表示把后面的数值转为字符

#32==#$20==" "
前者是10进制,后者有$是16进制

读书人网 >.NET

热点推荐