Hi!
I have some issues with the split() command and == “xyz”. I am currently creating a console like program, in which you can type “draw ellipse x y r1 r2”. However whenever I use String segments[] = split(command,' ');
it prints that the segments[0] = "draw"
however when I use if(segments[0] == "draw" {}
it says it is not the same.
String com = "draw circle";
void setup() {
}
void draw() {
}
void mousePressed() {
execute(com);
}
void execute(String command) {
String segments[] = split(command," ");
//println(segments[0],"draw");
//String comNew = "";
//for(int i = 0; i < segments[0].length(); i++) {
// comNew += segments[0].charAt(i);
//}
if(segments[0] == "draw") {
println("aaaaaaaaaaaaaa");
}
}