Batch-script-remove-both-ends

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

バッチスクリプト-両端を削除

これは、文字列の最初と最後の文字を削除するために使用されます

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

set str = %str:~1,-1%
echo %str%

上記のプログラムについて重要なことは、〜1、-1を使用して文字列の最初と最後の文字を削除することです。

出力

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

Batch scripts is easy. It is really easy
atch scripts is easy. It is really eas