Log in

View Full Version : String parsing missing.


AlexanderTheOK
05-02-2014, 23:18
I just attempted to mess with strings and have noticed that a lot of standard string functions are missing, such as replace all, split, etc. Is there a reason strings have heavily reduced functionality with the robot templates? More importantly, is there a way to get that functionality back? I noticed that regular java projects have a libraries folder with JDK inside, and the templates don't. Is this the culprit?

RufflesRidge
05-02-2014, 23:30
FRC robot programs use the Squawk JVM which is a derivative of a pretty old version of Java ME. This results in a lot of missing classes or functions you may be used to from using Java SE on the desktop.

otherguy
05-02-2014, 23:33
The JVM that runs on the cRIO doesn't have all the niceties that Java SE has (what's running on your desktop). We run on a version of Java ME.

You can write your own utilities functions to perform string operations.
Example string split function (https://github.com/Team254/FRC-2013/blob/master/src/com/team254/lib/util/Util.java)

Joe Ross
06-02-2014, 00:37
The 2015 control system will be using Java SE Embedded, so it will have the things you're missing.

notmattlythgoe
07-02-2014, 08:01
Having to use an old version of java drives me crazy, the lack of ENUMS and other commonly used tools gets frustrating after a while. I'm glad to hear that we'll be upgrading next year.