Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
6
Task/String-case/REXX/string-case-1.rexx
Normal file
6
Task/String-case/REXX/string-case-1.rexx
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
abc = "abcdefghijklmnopqrstuvwxyz" /*define all lowercase Latin letters.*/
|
||||
abcU = translate(abc) /* " " uppercase " " */
|
||||
|
||||
x = 'alphaBETA' /*define a string to a REXX variable. */
|
||||
y = translate(x) /*uppercase X and store it ───► Y */
|
||||
z = translate(x, abc, abcU) /*translate uppercase──►lowercase chars*/
|
||||
5
Task/String-case/REXX/string-case-2.rexx
Normal file
5
Task/String-case/REXX/string-case-2.rexx
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
x = "alphaBETA" /*define a string to a REXX variable. */
|
||||
parse upper var x y /*uppercase X and store it ───► Y */
|
||||
parse lower var x z /*lowercase X " " " ───► Z */
|
||||
|
||||
/*Some REXXes don't support the LOWER option for the PARSE command.*/
|
||||
5
Task/String-case/REXX/string-case-3.rexx
Normal file
5
Task/String-case/REXX/string-case-3.rexx
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
x = 'alphaBETA' /*define a string to a REXX variable. */
|
||||
y = upper(x) /*uppercase X and store it ───► Y */
|
||||
z = lower(x) /*lowercase X " " " ───► Z */
|
||||
|
||||
/*Some REXXes don't support the UPPER and LOWER BIFs (built-in functions).*/
|
||||
5
Task/String-case/REXX/string-case-4.rexx
Normal file
5
Task/String-case/REXX/string-case-4.rexx
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
x = "alphaBETA" /*define a string to a REXX variable. */
|
||||
y=x; upper y /*uppercase X and store it ───► Y */
|
||||
parse lower var x z /*lowercase Y " " " ───► Z */
|
||||
|
||||
/*Some REXXes don't support the LOWER option for the PARSE command.*/
|
||||
18
Task/String-case/REXX/string-case-5.rexx
Normal file
18
Task/String-case/REXX/string-case-5.rexx
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/*REXX program capitalizes each word in string, and maintains imbedded blanks. */
|
||||
x= "alef bet gimel dalet he vav zayin het tet yod kaf lamed mem nun samekh",
|
||||
"ayin pe tzadi qof resh shin tav." /*the "old" spelling of Hebrew letters.*/
|
||||
y= capitalize(x) /*capitalize each word in the string. */
|
||||
say x /*display the original string of words.*/
|
||||
say y /* " " capitalized words.*/
|
||||
exit /*stick a fork in it, we're all done. */
|
||||
/*──────────────────────────────────────────────────────────────────────────────────────*/
|
||||
capitalize: procedure; parse arg z; $=' 'z /*prefix $ string with a blank. */
|
||||
abc = "abcdefghijklmnopqrstuvwxyz" /*define all Latin lowercase letters.*/
|
||||
|
||||
do j=1 for 26 /*process each letter in the alphabet. */
|
||||
_=' 'substr(abc,j,1); _U=_ /*get a lowercase (Latin) letter. */
|
||||
upper _U /* " " uppercase " " */
|
||||
$=changestr(_, $, _U) /*maybe capitalize some word(s). */
|
||||
end /*j*/
|
||||
|
||||
return substr($, 2) /*return the capitalized words. */
|
||||
9
Task/String-case/REXX/string-case-6.rexx
Normal file
9
Task/String-case/REXX/string-case-6.rexx
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
/*REXX program swaps the letter case of a string: lower ──► upper & upper ──► lower.*/
|
||||
abc = "abcdefghijklmnopqrstuvwxyz" /*define all the lowercase letters. */
|
||||
abcU = translate(abc) /* " " " uppercase " */
|
||||
|
||||
x = 'alphaBETA' /*define a string to a REXX variable. */
|
||||
y = translate(x, abc || abcU, abcU || abc) /*swap case of X and store it ───► Y */
|
||||
say x
|
||||
say y
|
||||
/*stick a fork in it, we're all done. */
|
||||
11
Task/String-case/REXX/string-case-7.rexx
Normal file
11
Task/String-case/REXX/string-case-7.rexx
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
x='alphaBETA'; Say ' x='||x
|
||||
Say 'three ways to uppercase'
|
||||
u1=translate(x); Say ' u1='u1
|
||||
u2=upper(x); Say ' u2='u2
|
||||
parse upper var x u3; Say ' u3='u3
|
||||
|
||||
abc ='abcdefghijklmnopqrstuvwxyz'
|
||||
abcu=translate(abc); Say 'three ways to lowercase'
|
||||
l1=translate(x,abc,abcu); Say ' l1='l1
|
||||
l2=lower(x); Say ' l2='l2
|
||||
parse lower var x l3; Say ' l3='l3
|
||||
8
Task/String-case/REXX/string-case-8.rexx
Normal file
8
Task/String-case/REXX/string-case-8.rexx
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
uppercase: /*courtesy Gerard Schildberger */
|
||||
return translate(changestr("ß",translate(arg(1),'ÄÖÜ',"äöü"),'SS'))
|
||||
|
||||
uppercase2: Procedure
|
||||
Parse Arg a
|
||||
a=translate(arg(1),'ÄÖÜ',"äöü") /* translate lowercase umlaute */
|
||||
a=changestr("ß",a,'SS') /* replace ß with SS */
|
||||
return translate(a) /* translate lowercase letters */
|
||||
Loading…
Add table
Add a link
Reference in a new issue