Monday, 22 April 2013

Split String In Java Using Regex


public class SpitString {

 public static void main(String arg[]) {
  
  String userName = "Jack.Sparrow";
  String nickName = userName.split("\\.")[0];
  System.out.println("Your Nick Name \t"  + nickName);

 }

}

No comments:

Post a Comment