Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package firstuppercase;
- public class App {
- public static void main(String[] args) {
- var result = first("appmSiller");
- System.out.println(result);
- }
- public static char first(String str) {
- if ((str==null)||(str.length() <= 1))
- return 0;
- if(Character.isUpperCase(str.charAt(0))){
- return str.charAt(0);
- }
- return first(str.substring(1));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement