另外,单向转换大小写可以利用变量替换时不区分大小写的特性:- @echo off
- set 转换小写=a b c d e f g h i j k l m n o p q r s t u v w x y z
- set 转为大写=A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
- for /f "delims=" %%a in (1.txt) do (
- set tmp=%%a
- setlocal enabledelayedexpansion
- for %%b in (%转为小写%) do set tmp=!tmp:%%b=%%b!
- echo !tmp!
- endlocal
- )
- pause
复制代码
|