- Joined
- Feb 20, 2009
- Messages
- 1
- Reaction score
- 0
Hi,
I am facing one problem with replaceFirst method.
Requirement:
I have few strings with number 491720350000 - 491720351160.
I want to replace this strings with 497122350000 - 497122351160.
So meet this criteria i am using the code like this.
String match = "^4917203([0,9]{5,5})$";
String replace = "4971223$1";
String msisdn = "4917251116";
String newMsisdn = msisdn.replaceFirst(match, replace);
System.out.println("The new msisdn is "+ newMsisdn);
But this code doesnt work.
Please let me know what could be the problem.
I am facing one problem with replaceFirst method.
Requirement:
I have few strings with number 491720350000 - 491720351160.
I want to replace this strings with 497122350000 - 497122351160.
So meet this criteria i am using the code like this.
String match = "^4917203([0,9]{5,5})$";
String replace = "4971223$1";
String msisdn = "4917251116";
String newMsisdn = msisdn.replaceFirst(match, replace);
System.out.println("The new msisdn is "+ newMsisdn);
But this code doesnt work.
Please let me know what could be the problem.