掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
シート内の漢字、ひらがな、カタカナを一気に削除したい (ID:12168)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
こんな感じのもどうでしょうか? function RightStringOnly(const str: string): string; var i:integer; retval: string; begin if str = '' then begin Result := ''; exit; end; retval := ''; i:=1; repeat case ByteType(Copy(str, i, Length(str)),1) of mbSingleByte: begin if (str[i] in ['a'..'z','A'..'Z','0'..'9']) then retval := retval + str[i]; Inc(i, 1); end; mbLeadByte: begin Inc(i, 2); end; end; until (i > Length(str)); result := retval; end;
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.