LoginSignup
22
26

More than 5 years have passed since last update.

【Windows】バッチファイルで文字列操作

Posted at

部分文字列

文字列の5番目から2文字を抽出。(一文字目が0番目)

C:\>set V=ABCDEFGHIJKL
C:\>echo %V:~5,2%
FG

置換

文字列 "/" を " "(空白) に置換する

C:\>set dt=%date%
C:\>set dt
dt=2011/08/24
C:\>echo %dt:/= %
2011 08 24

参考サイト

22
26
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
22
26