Split result not usable on android

65 Views Asked by At

I have a string that I split, it works perfectly until i want to use it : when I use a 'for' to read what a have in my String table I shows exactly what I want, but when I use if(MyStringTable[1] == "a") it isn't true, even though I just saw that MyStringTable[1] was equal to "a". My string table is "static" declared. I'm wondering if there is an invisible character or something that has been created with the split.

1

There are 1 best solutions below

3
nKn On BEST ANSWER

In terms of Strings, use .equals() in order to check if a String is equal to another. If one of them is a character, cast it previously to a String using .toString() to make it match this approach.