StringUtil.tokenize incorrect results

41 views
Skip to first unread message

CODENAME1

unread,
Nov 2, 2016, 9:04:47 AM11/2/16
to CodenameOne Discussions
if i have a string say str =  busy,,hello1,hllo2,hello3
then StringUtil.tokenize(str,',') -> the list should have 4 times ..at index 0->busy..at index 1->empty....at index 2 hello1....at index 3 hello2....at index 4 hello3
but the current behaviour gives .                                            at index 0->busy..at index 1->,hello1....at index 2 hello2....at index 3 hello3


Steve Hannah

unread,
Nov 2, 2016, 12:10:02 PM11/2/16
to codenameone...@googlegroups.com
Which platform do you see this on?  Simulator? iOS?

Steve

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/3db28772-62f8-4bc9-af0c-8ce928f3ff98%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Steve Hannah
Software Developer
Codename One

CODENAME1

unread,
Nov 3, 2016, 4:52:57 AM11/3/16
to CodenameOne Discussions
simulator

Shai Almog

unread,
Nov 4, 2016, 1:35:12 AM11/4/16
to CodenameOne Discussions
That's not how it's supposed to work. String tokenizer doesn't provide empty blocks.
I think that what you are really looking for is the CSVParser

Carlos Verdier

unread,
Nov 4, 2016, 11:36:51 AM11/4/16
to CodenameOne Discussions
If I don't recall incorrectly, Util.split returns the kind of results you want...

CODENAME1

unread,
Nov 8, 2016, 2:42:15 AM11/8/16
to CodenameOne Discussions
Thanks..Util.split works :)
Reply all
Reply to author
Forward
0 new messages