Advertisement
Guest User

Books

a guest
Mar 17th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. private static boolean present(String title, String book) {
  2. int i = 0, j = title.length();
  3. String sub;
  4.  
  5. while (j <= book.length()) {
  6. sub = book.toLowerCase().substring(i, j);
  7. if (title.toLowerCase().equals(sub)) {
  8. return true;
  9. }
  10. i++;
  11. j++;
  12. }
  13. return false;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement