Skip to content

Instantly share code, notes, and snippets.

@ijprest
ijprest / toupper.bat
Created September 10, 2011 01:52
CMD Batch file implementation of toupper() and tolower()
@echo off & SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
SET STR=Test String
SET STR
call :tolower STR
SET STR
call :toupper STR
set STR
goto :EOF
:: toupper & tolower; makes use of the fact that string
@ijprest
ijprest / strlen.bat
Created September 1, 2011 03:41
CMD Batch file implementation of strlen
@echo off
setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
call :strlen "%~1"
echo strlen("%~1") == !ERRORLEVEL!
goto :EOF
:strlen
setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
set __LEN=0