-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update exos StringUtils to match String.split spec
- Loading branch information
1 parent
85c829c
commit 3b59d8a
Showing
5 changed files
with
82 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,19 @@ | ||
package src; | ||
|
||
|
||
public class StringUtils { | ||
|
||
|
||
/* | ||
* Split the input string 'str' w.r.t the character 'marker' in an array of String | ||
* for example split("test-test", '-') => {"test", "test"} | ||
* Must return null if there is no occurrence of 'marker' in 'str' | ||
*/ | ||
public static String [] split(String str, char marker){ | ||
|
||
public static String [] split(String str, char delimiter){ | ||
@ @student_split@@ | ||
|
||
} | ||
|
||
|
||
/* | ||
* Returns the index of the first occurrence of sub in str | ||
* or -1 if there is no occurrence of sub in str at all. | ||
* Be careful, we ask you to make CASE SENSITIVE comparison between str and sub. | ||
*/ | ||
public static int indexOf(String str, String sub){ | ||
@ @student_indexof@@ | ||
} | ||
|
||
|
||
public static String toLowerCase(String str){ | ||
@ @student_tolowercase@@ | ||
} | ||
|
||
|
||
/* | ||
* Returns true if the string 'str' is a palindrome (a string that reads the same from | ||
* left to right AND from right to left). | ||
*/ | ||
public static boolean palindrome(String str){ | ||
@ @student_palindrome@@ | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters