#How to compare symbols literally in Java?
12 messages · Page 1 of 1 (latest)
you could use contains('+')
But it just does a linear search, so you should be able to do it yourself if you tried
I tried, Java thinks I’m combining strings not the literal symbol
Show what you tried.
you want the char value searched?
I don't really understand what you mean by combining strings
public class CombingingStrings {
public static void main(String[] args) {
String cat = "cat";
String dog = "dog";
String catdog = cat + dog;
System.out.println(catdog);
}
}
Chances are good that they're talking about concatenating strings.
This is what Java thinks I’m doing when search for “+”
It keep saying smth like not a char
I forgot the exact error
could you show some code?