ReplaceFirst method in string....

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top