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?
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.
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
The 2015 control system will be using Java SE Embedded, so it will have the things you’re missing.
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.