September Morn Update
This commit is contained in:
parent
4e2d22a71d
commit
aac6731f2c
6856 changed files with 141342 additions and 21127 deletions
18
Task/String-case/SNOBOL4/string-case-2.sno
Normal file
18
Task/String-case/SNOBOL4/string-case-2.sno
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue