So basically I'm trying to write a method that takes 2 strings as parameters and returns a boolean. It returns true if t occurs as a token within s, and returns false if otherwise.
I'm pretty new to coding so I don't really know what i'm doing wrong, any help is appreciated!
Here's my code:
public static boolean containsToken(String s, String t) {
Scanner scr = new Scanner(s);
This scanner breaks up String s into tokens
for(int i = 0; i < s.length(); i++) {
I tried to make this for loop search through the length of s for tokens that match up with String t
if(t.contains(scr.next()))
return true;
}
return false;
}