Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 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
|
||||
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