Medyy

Untitled

Feb 26th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. private String abrNom(String nom)
  2. {
  3. String res ="";
  4.  
  5. nom.trim();
  6. if(nom.length()==1)
  7. return nom+"Spc";
  8. else
  9. {
  10. for(int i=0;i<nom.length();i++)
  11.  
  12. if(i==0)
  13. res+=nom.charAt(i);
  14. else
  15. {
  16. if(nom.charAt(i-1)==' ' & nom.charAt(i)!=' ')
  17. res+=nom.charAt(i);
  18.  
  19. }
  20. }
  21. return res;
  22.  
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment