I have
String x = g.substring(0, 1);
if (x == "S") {
stuff
}
I have a string, "Safety", but "stuff" doesn't run and my watch say x value = S and x=="S" = false.
Many problems...
Your variable x is a String! You shouldn't use == operator with that, use .equals() instead
Also, while you're at it, you should use .equalsIgnoreCase() to ignore case.
By the way, I should note that there is the String.charAt(int) function too, which returns the character at the specified place...
But if you would like to select all Strings (your question didn't reveal your original intentions why and what you are trying to achieve), but I'd look into regular expressions, and using String.matches()