Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1)-----
- 1: This should be....
- String fileName = "c:\\dictionaries\\words.txt";
- 2:
- private boolean endsWithStar(String s)
- {
- int len = s.length();
- return len > 0 && s.charAt(len - 1) == '*';
- }
- or
- private boolean endsWithStar(String s)
- {
- return s.endsWith("*");
- }
- 3: public static void main (ss) {
- for (int x = 0; x < ss.length()-1; x++) {
- if ( ss.charAtPos(x) != '-') {
- System.out.print (ss.charAt(x));
- }
- }
- 4:
- dateStr = dateStr.substring(3,5) + '-' +
- dateStr.substring(0,2) + '-' +
- dateStr.substring(6);
- 5:
- String last4 = ccNumber.substring(15);
- 2)-----
- Compare to compares the ascii values of the equivalent letters in the according positions, and then returns the difference in the values.
- 3)-----
- 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