Re: Turning a Text Sequence into a Sequence Array
- Posted by DerekParnell (admin) Jul 09, 2010
- 3657 views
jimcbrown said...
Kaladan said...
Hi, I'm new here. And new to the language. I did a search for this subject but I was unlucky. I was wondering if anyone could tell me the easiest or quickest way to turn a Text Sequence into a sequence array. In other words I want to turn this:
"This is only theoretically a sentence."
into this:
{"This", "is", "only", "theoretically", "a", "sentence."}
Any help would be much appreciated.
Kaladan
Use split() from std/sequence.e
With Euphoria v4, the standard library module sequence.e contains the split function. It can be used like this ...
include std/console.e include std/sequence.e sequence text = "This is only theoretically a sentence." sequence result = split(' ', text) display (result)
The output would be ...
{ "This", "is", "only", "theoretically", "a", "sentence." }