StringUtil.tokenize incorrect results

41 vistas
Ir al primer mensaje no leído

CODENAME1

no leída,
2 nov 2016, 9:04:47 a.m.2/11/2016
para 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

no leída,
2 nov 2016, 12:10:02 p.m.2/11/2016
para 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

no leída,
3 nov 2016, 4:52:57 a.m.3/11/2016
para CodenameOne Discussions
simulator

Shai Almog

no leída,
4 nov 2016, 1:35:12 a.m.4/11/2016
para 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

no leída,
4 nov 2016, 11:36:51 a.m.4/11/2016
para CodenameOne Discussions
If I don't recall incorrectly, Util.split returns the kind of results you want...

CODENAME1

no leída,
8 nov 2016, 2:42:15 a.m.8/11/2016
para CodenameOne Discussions
Thanks..Util.split works :)
Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos