Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Checks if provided String ends with char from target.
- * @param source String that we check
- * @param target Char that we check for
- * @return boolean that states if source does or doesn't end with char from target.
- * @author Dimitar Naydenov
- */
- public static boolean endsWith(String source, char target) {
- String[] arr = source.split("");
- if (arr[arr.length - 1].equals(Character.toString(target))) {
- return true;
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment