Skip to content

Commit

Permalink
finishd camel, reverse, reversecamel
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim L authored and Tim L committed Jul 8, 2024
1 parent 67b5a37 commit 2bec8f0
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,30 @@ public class BasicStringUtils {
* @return string with identical content, and the first character capitalized
*/
public static String camelCase(String str) {
return null;
String result = str.substring(0, 1).toUpperCase() + str.substring(1);
return result;
// return null;
}

/**
* @param str string input from client
* @return string with identical contents, in the reverse order
*/
public static String reverse(String str) {
return null;
String result = new StringBuilder(str).reverse().toString();
return result;
// return null;
}

/**
* @param str string input from client
* @return string with identical contents, in reverse order, with first character capitalized
*/
public static String reverseThenCamelCase(String str) {
return null;
String reverse = new StringBuilder(str).reverse().toString();
String result = reverse.substring(0, 1).toUpperCase() + reverse.substring(1);
return result;
// return null;
}


Expand Down

0 comments on commit 2bec8f0

Please sign in to comment.