Tokenize a string: Difference between revisions
Content added Content deleted
m (→{{header|Haskell}}: The wiki interpreted part of the program as Wikilink, which clearly wasn't intended) |
(→{{header|Smalltalk}}: more) |
||
Line 327: | Line 327: | ||
=={{header|Smalltalk}}== |
=={{header|Smalltalk}}== |
||
|array | |
|array | |
||
array := |
array := 'Hello,How,Are,You,Today' subStrings: $,. |
||
⚫ | |||
Transcript show: |
|||
(array inject: '' |
|||
Some implementations also have a ''join:'' convenience method that allows the following shorter solution: |
|||
into: |
|||
⚫ | |||
('Hello,How,Are,You,Today' subStrings: $,) join: '.' |
|||
The solution displaying a trailing period would be: |
|||
|array | |
|||
array := 'Hello,How,Are,You,Today' subStrings: $,. |
|||
array inject: '' into: [:concatenation :string | concatenation, string, '.' ] |
|||
=={{header|Standard ML}}== |
=={{header|Standard ML}}== |