I can\'t seem to find the syntax needed for the for loop in this method. I am looking to iterate through the words in the string suit.
suit
EDIT: one thing t
If all you want to do is replace the strings that contain "SPADES":
public String getSuit(int card){ String suit = cardArray.get(card); if (suit.contains("SPADES")){ cardArray.set(card, "SPADES"); } return suit; }
If you want to split the string suit for some other reason then see the other answers