Batch-script-remove

提供:Dev Guides
2020年6月23日 (火) 09:41時点におけるMaintenance script (トーク | 投稿記録)による版 (Imported from text file)
(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)
移動先:案内検索

バッチスクリプト-削除

文字列置換機能を使用して、別の文字列から部分文字列を削除することもできます。

@echo off
set str = Batch scripts is easy. It is really easy.
echo %str%

set str = %str:is = %
echo %str%

上記のプログラムについて注意すべき重要な点は、「is」という単語が、: ’stringtoberemoved’ =コマンドを使用して文字列から削除されていることです。

出力

上記のコマンドは、次の出力を生成します。

Batch scripts is easy. It is really easy.
Batch scripts easy. It really easy.