拥有一套/ p忽略大写字母批 [英] Having set /p ignore capital letters in batch

查看:80
本文介绍了拥有一套/ p忽略大写字母批的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么办法(通过标签或其他明智的)有设置/ p忽略在批处理脚本中的大写字母?

Is there any way (via tag or other wise) to have Set /p ignore capital letters in a batch script?

推荐答案

我不知道忽视,但你可以将它们转换为小写。

I don't know about ignore, but you could convert them to lower case.

Set /P Text=Please type something: 
Set Text=%Text:A=a%
Set Text=%Text:B=b%
Set Text=%Text:C=c%
...
Echo %Text%

如果你想使用一个命令转换为小写:

If you wanted to use a For command to convert to lower case:

Set Text /P=Please type something: 
For %%i In ("A=a" "B=b" "C=c" ...) Do Call Set "Text=%%Text:%%~i%%"
Echo %Text%

或更换A = AA =等,以消除资金。

Or replace "A=a" with "A=", etc. to remove capitals.

这篇关于拥有一套/ p忽略大写字母批的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆