all tasks
This commit is contained in:
parent
b83f433714
commit
68f8f3e56b
14735 changed files with 178959 additions and 0 deletions
17
Task/Tokenize-a-string/REXX/tokenize-a-string-1.rexx
Normal file
17
Task/Tokenize-a-string/REXX/tokenize-a-string-1.rexx
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
/*REXX program to seperate a string of comma-delimited words, and echo. */
|
||||
sss = 'Hello,How,Are,You,Today' /*words seperated by commas (,). */
|
||||
say 'input string='sss /*display the original string. */
|
||||
new=sss /*make a copy of the string. */
|
||||
|
||||
do items=1 until new=='' /*keep going until SSS is empty. */
|
||||
parse var new a.items ',' new /*parse words delinated by comma.*/
|
||||
end /*items*/
|
||||
|
||||
say; say 'Words in the string:' /*display a header for the list. */
|
||||
|
||||
do k=1 for items /*now, display all the words. */
|
||||
say a.k'.' /*append a period to the word. */
|
||||
end /*k*/
|
||||
|
||||
say 'End-of-list.' /*display a trailer for the list.*/
|
||||
/*stick a fork in it, we're done.*/
|
||||
10
Task/Tokenize-a-string/REXX/tokenize-a-string-2.rexx
Normal file
10
Task/Tokenize-a-string/REXX/tokenize-a-string-2.rexx
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
/*REXX program to separate a string of comma-delimited words and echo */
|
||||
sss='Hello,How,Are,You,Today'
|
||||
say 'input string='sss
|
||||
say ''
|
||||
say 'Words in the string:'
|
||||
ss =translate(sss,' ',',')
|
||||
Do i=1 To words(ss)
|
||||
say word(ss,i)'.'
|
||||
End
|
||||
say 'End-of-list.'
|
||||
Loading…
Add table
Add a link
Reference in a new issue