Tokenize a string: Difference between revisions

Content added Content deleted
No edit summary
(Python version)
Line 19: Line 19:
my @words = split(/,/, "Hello,How,Are,You,Today");
my @words = split(/,/, "Hello,How,Are,You,Today");
print $_.'.' for (@words);
print $_.'.' for (@words);

==[[Python]]==
[[Category:Python]]
'''Interpreter:''' Python 2.5

words = "Hello,How,Are,You,Today".split(',')
for word in words:
print word


==[[Ruby]]==
==[[Ruby]]==