Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- String name = "Avul Pakir Jainulabdeen Abdul kalam";
- String[] splitedName = name.split("\\s");
- String shortName = "";
- int len = (splitedName.length - 1);
- for (int i = 0; i < len; i++)
- shortName = shortName.concat(splitedName[i].charAt(0) + ". ");
- shortName = shortName.concat(splitedName[len]);
- System.out.println(shortName.toUpperCase());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement