Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @ECHO OFF
- Setlocal DisableDelayedExpansion
- (Set LF=^
- %= Above Empty lines Required =%)
- Set ^"\n=^^^%LF%%LF%^%LF%%LF%^^"
- ::: { Case Conversion Macro %CASE% <Var Name> </U=UPPER /L=lower>
- Set CASE=For %%n in (1 2) Do IF %%n==2 (%\n%
- For /F "Tokens=1,2 Delims=, " %%G in ("!CONVERT!") Do (%\n%
- (IF /I "%%H" == "/U" (For %%x in (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) Do (Set "%%~G=!%%~G:%%x=%%x!")) ^&^& Echo !%%G!)%\n%
- (IF /I "%%H" == "/L" (For %%x in (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) Do (Set "%%~G=!%%~G:%%x=%%x!")) ^&^& Echo !%%G!)%\n%
- )%\n%
- ) Else Set CONVERT=,
- ::: }
- Setlocal EnableDelayedExpansion
- Set /P "String=String: "
- %CASE% String /U
- %CASE% String /L
- Pause > Nul
- Exit /B
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement