I have a function which gets passed in a string. From that I split the string with
String[] info = s.split("\\s+");
I then want to see if the first index is a plus sign (+). If i enter in a string: + other stuff it claims that + != +
System.out.println("Check if "+ info[0]+ " = +");
if(info[0]=="+") {
System.out.println("yes");
} else
System.out.println("no");
This is the output i get:
Interp> +
Check if + = +
no
anyone know why this is?