RosettaCodeData/Task/String-case/REXX/string-case-6.rexx

10 lines
579 B
Rexx
Raw Permalink Normal View History

2016-12-05 22:15:40 +01:00
/*REXX program swaps the letter case of a string: lower ──► upper & upper ──► lower.*/
abc = "abcdefghijklmnopqrstuvwxyz" /*define all the lowercase letters. */
abcU = translate(abc) /* " " " uppercase " */
2013-04-11 01:07:29 -07:00
2016-12-05 22:15:40 +01:00
x = 'alphaBETA' /*define a string to a REXX variable. */
y = translate(x, abc || abcU, abcU || abc) /*swap case of X and store it ───► Y */
2013-04-11 01:07:29 -07:00
say x
say y
2016-12-05 22:15:40 +01:00
/*stick a fork in it, we're all done. */