#How to compare symbols literally in Java?

12 messages · Page 1 of 1 (latest)

honest sorrel
#

For example, how do I check if a string has + in it. If I put it into .charAt in a linear search, it thinks I’m combining something. Tyvm

stark ledge
#

you could use contains('+')

#

But it just does a linear search, so you should be able to do it yourself if you tried

honest sorrel
#

I tried, Java thinks I’m combining strings not the literal symbol

light cargo
#

Show what you tried.

stable portal
#

I don't really understand what you mean by combining strings

light cargo
honest sorrel
#

It keep saying smth like not a char

#

I forgot the exact error

stable portal