Batch-script-remove

提供:Dev Guides
移動先:案内検索

バッチスクリプト-削除

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

@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.