Tokenize a string: Difference between revisions

Content added Content deleted
(→‎[[JavaScript]]: Make it a one-liner)
Line 253: Line 253:


tokens := split("Hello,How,Are,You,Today", ",");
tokens := split("Hello,How,Are,You,Today", ",");

==[[Smalltalk]]==
[[Category:Smalltalk]]

|array |
array := ('Hello,How,Are,You,Today' findTokens: $,) asArray.
Transcript show:
(array inject: ''
into:
[:concatenation :string | concatenation , string , '.'])


==[[Standard ML]]==
==[[Standard ML]]==