掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
Trimについて (ID:32599)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
無限ループの危険を回避。 function TrimEx(const S: string): string; var I, L: Integer; begin L := Length(S); I := 1; while (I <= L) and ((S[I] <= ' ')or(S[I] = #$81)) do begin if (S[I] = #$81) then if (S[I+1] = #$40) then Inc(I) else break; Inc(I); end; if I > L then Result := '' else begin while (S[L] <= ' ')or(S[L] = #$40) do begin if (S[L] = #$40) then if (S[L-1] = #$81) then Dec(L) else break; Dec(L); end; Result := Copy(S, I, L - I + 1); end; end;
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.