September Morn Update
This commit is contained in:
parent
4e2d22a71d
commit
aac6731f2c
6856 changed files with 141342 additions and 21127 deletions
26
Task/String-case/SNOBOL4/string-case-1.sno
Normal file
26
Task/String-case/SNOBOL4/string-case-1.sno
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
define('uc(str)') :(uc_end)
|
||||
uc uc = replace(str,&lcase,&ucase) :(return)
|
||||
uc_end
|
||||
|
||||
define('lc(str)') :(lc_end)
|
||||
lc lc = replace(str,&ucase,&lcase) :(return)
|
||||
lc_end
|
||||
|
||||
define('ucfirst(str)ch') :(ucfirst_end)
|
||||
ucfirst str len(1) . ch = uc(ch)
|
||||
ucfirst = str :(return)
|
||||
ucfirst_end
|
||||
|
||||
define('swapc(str)') :(swapc_end)
|
||||
swapc str = replace(str,&ucase &lcase, &lcase &ucase)
|
||||
swapc = str :(return)
|
||||
swapc_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