Auralias
Auralias
JCHJava Community | Help. Code. Learn.
Created by Auralias on 10/18/2024 in #java-help
Comparing strings problem
I have a function called getDirection() which gives me the direction of a character, it is either "north", "south", "east" or "west".. then i have another functtion which splits non cardinal directions into x and y components. For example, north west to "north" and "west".. now when i compare getDirection() with the x component of that complex direcction, it says its not equal.. but when i just write the x component as a string (Manually) it says it is equal! getDirection() is not equal to xDir getDirection() is equal to "west" xDir is "west" and the character is also facing west, ive checked for spaces alrdy
4 replies