over 5 years ago
Sometimes, we need to change some special character on String to fulfill our requirements.
For example, we need to show phone number, i.e, 2001256443 as (200)-125-6443
Now we use the substring method of String to solve it.
We just add String on the particular location.
String phone = "2001256443";
String mobile = null;
mobile = "(" + phone.substring(0, 3) + ")" + phone.substring(3, 6) + "-" + phone.substring(6, phone.length());
System.out.println("Phone : "+mobile);
Phone : (200)-125-6443
Starting with Chrome version 45, NPAPI is no longer supported for Google Chrome. For more information, see Chrome and NPAPI (blog.chromium.org).
Firefox and Microsoft Internet Explorer are recommended browsers for websites using java applets.
Chrome Version Support
Are you sure, you want to delete this comment?
Terms of Service
| © copyright 2021 FindNerd.com. All rights reserved.
Sign up using