home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Phoenix CD 2.0
/
Phoenix_CD.cdr
/
01e
/
let12.zip
/
DEMO-4.BAT
< prev
next >
Wrap
DOS Batch File
|
1987-09-17
|
1KB
|
41 lines
echo Off
If `%Name%' == `' Demo
if `%1' == `AskAgain' goto AskAgain
cls
echo ╔════════════════════════════════════════════════════════════════╗
echo ┌─╫────────────────────────────────────────────────────────────────╫─┐
echo │ ║ String Manipulation (part 1): UPPER, LOWER, PROPER ║ │
echo └─╫────────────────────────────────────────────────────────────────╫─┘
echo ╚════════════════════════════════════════════════════════════════╝
echo
echo One of the most powerful features of LET is its ability to
echo Manipulate Strings! Let me show you just some of the possibilities.
echo
:AskAgain
LET Str=(ask "Give me a line of text: ")
LET Check=(substr (- 60 (length Str)) 1 1)
rem the previous check determines if the length is greater than 60
rem by seeing if the subtraction results in a negative number.
if not `%Check%' == `-' goto OkStrLen
LET Str=(substr Str 1 60)
echo %Name%, that string is a bit long, so I'm going to
echo shorten it down a bit, if you don't mind. We'll use the string
echo "%Str%"
:OkStrLen
if not `%Check%' == `6' goto NotNull
LET Str="This is a PROVIDED string for YoUr BeNeFit!"
echo Ok, so you're shy. I'll provide the string:
echo It is this---> %Str%
:NotNull
echo I'm going to fool around with the cases of letters, for example:
LET dummy=(do "ShiftCas")
echo Upper Case: %U%
echo Lower Case: %L%
echo Capitalized: %P%
echo
pause
set U=
set L=
set P=
DEMO-5