くだすれDelphi(超初心者用)その46at TECH
くだすれDelphi(超初心者用)その46 - 暇つぶし2ch639:デフォルトの名無しさん
08/05/11 08:09:33
function DecodeEscStr(const s: string): string;
var i: integer;
begin
 Result := ''; i := 1;
 while i <= length(s) do
  if s[i] in LeadBytes then
  begin Result := Result + copy(s, i, 2); inc(i, 2);
  end else begin
   if s[i] = '\' then
   begin  inc(i); case s[i] of
     'x':try
       Result := Result + char(StrToInt('$' + s[i + 1] + s[i + 2]));
       inc(i, 2);
      except end;
     'b': Result := Result + #$08;
     'a': Result := Result + #$07;
     'f': Result := Result + #$0C;
     'r': Result := Result + #$0D;
     't': Result := Result + #$09;
     'v': Result := Result + #$0B;
     'n': Result := Result + #13 + #10;
     else Result := Result + s[i];
    end;
    inc(i);
   end else begin
    Result := Result + s[i]; inc(i);
   end;
  end;
end;


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch