字母大寫轉小寫源碼

版權聲明:本文爲博主原創文章,未經博主允許不得轉載。 https://blog.csdn.net/wengek/article/details/77931230

源碼如下:

@echo off&setlocal enabledelayedexpansion
title 字母大寫轉小寫
:a
set b=-1
set /p a=
:b
set /a b+=1
set d=%c%
for %%a in (%b%) do if not "!a:~%%a,1!"=="" (
if "!a:~%%a,1!"=="A" set c=a&goto c
if "!a:~%%a,1!"=="B" set c=b&goto c
if "!a:~%%a,1!"=="C" set c=c&goto c
if "!a:~%%a,1!"=="D" set c=d&goto c
if "!a:~%%a,1!"=="E" set c=e&goto c
if "!a:~%%a,1!"=="F" set c=f&goto c
if "!a:~%%a,1!"=="G" set c=g&goto c
if "!a:~%%a,1!"=="H" set c=h&goto c
if "!a:~%%a,1!"=="I" set c=i&goto c
if "!a:~%%a,1!"=="J" set c=j&goto c
if "!a:~%%a,1!"=="K" set c=k&goto c
if "!a:~%%a,1!"=="M" set c=m&goto c
if "!a:~%%a,1!"=="N" set c=n&goto c
if "!a:~%%a,1!"=="L" set c=l&goto c
if "!a:~%%a,1!"=="O" set c=o&goto c
if "!a:~%%a,1!"=="P" set c=p&goto c
if "!a:~%%a,1!"=="Q" set c=q&goto c
if "!a:~%%a,1!"=="R" set c=r&goto c
if "!a:~%%a,1!"=="S" set c=s&goto c
if "!a:~%%a,1!"=="T" set c=t&goto c
if "!a:~%%a,1!"=="U" set c=u&goto c
if "!a:~%%a,1!"=="V" set c=v&goto c
if "!a:~%%a,1!"=="W" set c=w&goto c
if "!a:~%%a,1!"=="X" set c=x&goto c
if "!a:~%%a,1!"=="Y" set c=y&goto c
if "!a:~%%a,1!"=="Z" set c=z&goto c
set c=!a:~%%a,1!&goto c
)
echo %c%
echo.
goto a
:c
if not %b% equ 0 set c=%d%%c%
goto b


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章