"Error: cannot find symbol" on String.split() and String.replace() methods?

716 views
Skip to first unread message

clementl...@gmail.com

unread,
Feb 8, 2015, 10:36:59 AM2/8/15
to codenameone...@googlegroups.com
Hi,

I get an "Error: cannot find sympbol" on this line:

                        String [] links = value.split(",")

Is it something expected?



The full trace:

Compiling 4 source files to H:\NetBeansProjects\CodenameOneJava7HelloWorld\build\tmp
H:\NetBeansProjects\CodenameOneJava7HelloWorld\src\userclasses\StateMachine.java:111: error: cannot find symbol
                        String [] links = value.split(",");
  symbol:   method split(String)
  location: variable value of type String
H:\NetBeansProjects\CodenameOneJava7HelloWorld\src\userclasses\StateMachine.java:112: error: method replace in class String cannot be applied to given types;
                        String link = links[0].replace("thumbnail=", "");
  required: char,char
  found: String,String
  reason: actual argument String cannot be converted to char by method invocation conversion


Thanks!

Clement

David Wafula

unread,
Feb 8, 2015, 3:37:45 PM2/8/15
to CodenameOne Discussions
Use StringUtil:

StringUtil.tokenize(..)

Regards

--
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-discu...@googlegroups.com.
Visit this group at http://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/241917af-1522-4bd4-9994-0dc0b7898e1f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
David Wafula

Shai Almog

unread,
Feb 9, 2015, 1:38:05 AM2/9/15
to codenameone...@googlegroups.com
Hi,
Some core methods in the JDK aren't supported. Specifically String.split() requires a regular expression parser which is very hard to get right and 100% compatible with the JDK.
It was also hard to get it to work on all the different JVM's we support (Windows, iOS mostly). Now that we are transitioning to the new iOS VM this will hopefully open the gateway, ideally we will port it to Windows Phone and then adding new methods/functionality to the base JVM API support should become far easier since our internal code base will be unified.
Reply all
Reply to author
Forward
0 new messages