You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.8 KiB

7 years ago
  1. /*
  2. * NEIU CS207-2 Fall 2018
  3. * Homework 4 TestStringPractice.java
  4. * This is the class with a main(), to test StringPractice
  5. */
  6. public class TestStringPractice
  7. {
  8. public static void main(String[] args)
  9. {
  10. StringPractice s1 = new StringPractice("Hello world, welcome to the Java world.");
  11. /*
  12. System.out.println(s1.makeSubstring(0));
  13. System.out.println(s1.makeSubstring(6));
  14. System.out.println(s1.makeSubstring(6, 14));
  15. System.out.println(s1.makeSubstring(13));
  16. System.out.println(s1.makeSubstring(0, 12));
  17. System.out.println();
  18. */
  19. /*
  20. System.out.println(s1.findIndexOf('w'));
  21. System.out.println(s1.findIndexOf('m'));
  22. System.out.println(s1.findIndexOf('x'));
  23. System.out.println(s1.findIndexOf('J'));
  24. System.out.println(s1.findIndexOf('a'));
  25. System.out.println();
  26. */
  27. /*
  28. System.out.println(s1.findIndexOf('w', 7));
  29. System.out.println(s1.findIndexOf('m', 20));
  30. System.out.println(s1.findIndexOf('x', 10));
  31. System.out.println(s1.findIndexOf('J', 30));
  32. System.out.println(s1.findIndexOf('a', 30));
  33. System.out.println();
  34. */
  35. /*
  36. System.out.println(s1.findIndexOf("wo"));
  37. System.out.println(s1.findIndexOf("we"));
  38. System.out.println(s1.findIndexOf("He"));
  39. System.out.println(s1.findIndexOf("Ja"));
  40. System.out.println(s1.findIndexOf("va"));
  41. System.out.println();
  42. */
  43. /*
  44. System.out.println(s1.findIndexOf("wo", 7));
  45. System.out.println(s1.findIndexOf("we", 20));
  46. System.out.println(s1.findIndexOf("He", 10));
  47. System.out.println(s1.findIndexOf("Ja", 30));
  48. System.out.println(s1.findIndexOf("va", 25));
  49. System.out.println();
  50. */
  51. } // End main()
  52. } // End class TestStringPractice