19 lines
628 B
Plaintext
19 lines
628 B
Plaintext
define('UC(STR)')
|
|
define('LC(STR)')
|
|
define('UCFIRST(STR)')
|
|
define('SWAPC(STR)') :(CASES.END)
|
|
UC uc = replace(str,&lcase,&ucase) :(RETURN)
|
|
LC lc = replace(str,&ucase,&lcase) :(RETURN)
|
|
UCFIRST str len(1) . ch = uc(ch) ; ucfirst = str :(RETURN)
|
|
SWAPC swapc = replace(str, &ucase &lcase, &lcase &ucase) :(RETURN)
|
|
CASES.END
|
|
|
|
* # Test and display
|
|
str = 'alphaBETA'
|
|
output = str
|
|
output = lc(str)
|
|
output = uc(str)
|
|
output = ucfirst(str)
|
|
output = swapc(str)
|
|
END
|