Guest User

Untitled

a guest
May 20th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. 1)-----
  2. 1: This should be....
  3. String fileName = "c:\\dictionaries\\words.txt";
  4. 2:
  5. private boolean endsWithStar(String s)
  6. {
  7. int len = s.length();
  8. return len > 0 && s.charAt(len - 1) == '*';
  9. }
  10. or
  11. private boolean endsWithStar(String s)
  12. {
  13. return s.endsWith("*");
  14. }
  15. 3: public static void main (ss) {
  16. for (int x = 0; x < ss.length()-1; x++) {
  17. if ( ss.charAtPos(x) != '-') {
  18. System.out.print (ss.charAt(x));
  19. }
  20. }
  21. 4:
  22. dateStr = dateStr.substring(3,5) + '-' +
  23. dateStr.substring(0,2) + '-' +
  24. dateStr.substring(6);
  25. 5:
  26. String last4 = ccNumber.substring(15);
  27.  
  28. 2)-----
  29. Compare to compares the ascii values of the equivalent letters in the according positions, and then returns the difference in the values.
  30.  
  31. 3)-----
  32. It will ignore the case of the strings inputted. If the string "Cat" and the string "cat" are inputted, it will return 0.
Add Comment
Please, Sign In to add comment