In your example you are comparing the string objects, not their content.
Your comparison should be :
if ("/quit"s.equals(s"/quit")) In your example you are comparing theOr if s string objects, not their content.nullity doesn't mind / or you really don't like NPEs:
if ("/quit".equals(s))