RosettaCodeData/Task/Tokenize-a-string/REXX/tokenize-a-string-2.rexx

13 lines
289 B
Rexx
Raw Permalink Normal View History

2013-04-11 01:07:29 -07:00
/*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,' ',',')
2019-09-12 10:33:56 -07:00
dot='.'
2013-04-11 01:07:29 -07:00
Do i=1 To words(ss)
2019-09-12 10:33:56 -07:00
If i=words(ss) Then dot=''
say word(ss,i)dot
2013-04-11 01:07:29 -07:00
End
say 'End-of-list.'