Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.35 KB | None | 0 0
  1. /*String to be split*/
  2. String str = lastName;
  3. String[] lastN;
  4. /*Delimiter*/
  5. String delimiter = "";
  6. /*Split by spaces*/
  7. lastN = str.split(delimiter)
  8. /*store last substring which be last name*/
  9. lastN=nameList[-1];
  10. if (lastName.length() > 3 && idNumber.length() > 2)
  11. {
  12. return lastName[0-3] + idNumber[0-2];
  13. }
  14. else
  15. {
  16. return lastName + idNumber;
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement