Skip to content

Instantly share code, notes, and snippets.

@au5ton
Created February 2, 2016 21:19
Show Gist options
  • Save au5ton/511e8d1400e69ee489cb to your computer and use it in GitHub Desktop.
Save au5ton/511e8d1400e69ee489cb to your computer and use it in GitHub Desktop.
public class StringChecker {
private String word;
public StringChecker() {
setString("");
}
public StringChecker(String s) {
setString(s);
}
public void setString(String s) {
word = s;
}
public boolean findLetter(char c) {
if(word.indexOf(c) != -1) {
return true;
}
else {
return false;
}
}
public boolean findSubString(String s) {
if(word.indexOf(s) != -1) {
return true;
}
else {
return false;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment