Quoting constructs: Difference between revisions

m
→‎{{header|REXX}}: added some comments and another example.
(→‎{{header|REXX}}: added the REXX computer programming language for this task.)
m (→‎{{header|REXX}}: added some comments and another example.)
Line 301:
There are no "escape" characters used in the REXX language.
<lang rexx>/*REXX program demonstrates various ways to express a string of characters or numbers.*/
 
a= 'This is one method of including a '' (an apostrophe) within a string.'
b= "This is one method of including a ' (an apostrophe) within a string."
Line 307 ⟶ 306:
/*sometimes, an apostrophe is called */
/*a quote. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
 
 
c= "This is one method of including a "" (a double quote) within a string."
d= 'This is one method of including a " (a double quote) within a string.'
Line 315 ⟶ 313:
/*called a quote, which can make for */
/*some confusion and bewilderment. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
 
 
f= 'This is one method of expressing a long literal by concatenations, the' || ,
'trailing character of the above clause must contain a trailing ' || ,
'comma (,) === note the embedded trailing blank in the above 2 statements.'
/*──────────────────────────────────────────────────────────────────────────────────────*/
 
g= 'This is another method of expressing a long literal by ' ,
 
"abutments, the trailing character of the above clause must " ,
g= 'This is another method of expressing a long literal by ' ,
"abutments, the trailing character of the above clause must " ,
'contain a trailing comma (,)'
/*──────────────────────────────────────────────────────────────────────────────────────*/
 
 
h= 'This is another method of expressing a long literal by ' , /*still continued.*/
"abutments, the trailing character of the above clause must " ,
'contain a trailing comma (,) --- in this case, the comment /* ... */ is ' ,
'essentially is not considered to be "part of" the REXX clause.'
/*──────────────────────────────────────────────────────────────────────────────────────*/
 
 
 
i= 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109
 
/*This is one way to express a list of */
/*numbers that don't have a sign. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
 
 
j= 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109,
71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181
Line 349 ⟶ 341:
/*implies a blank is abutted to first */
/*part of the REXX statement. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
k= '-2 3 +5 7 -11 13 17 19 -23 29 -31 37 -41 43 47 -53 59 -61 67 -71 73 79 -83 89 97 -101' 103 107 109,
71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181
 
l= a b c d e f g h i j k /*thisThe will createJ a listand of allK the values are identical,*/
 
/*superfluous and extraneous blanks are*/
k= '-2 3 +5 7 -11 13 17 19 -23 29 -31 37 -41 43 47 -53 59 -61 67 -71 73 79 -83 89 97 -101'
/*ignored. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
l= '-2 3 +5 7 -11 13 17 19 -23 29 -31 37 -41 43 47 -53 59 -61 67 -71 73 79 -83 89 97 -101'
 
/*This is one way to express a list of */
/*numbers that have a sign. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
 
m= a b c d e f g h i j k l /*this will create a list of all the */
 
l= a b c d e f g h i j k /*this will create a list of all the */
/*listed strings listed (so far) into */
/*the variable L (with an */