I want to write a java API which excepts two input parameters. First inputStr and second strFormat.
public String covertString(String inputStr, String strFormat)
{
// Need logic
}
For example,
Input Arguments- inputStr: 999999999, strFormat: xxx-xx-xxxx
Output : 999-99-9999
Input Arguments- inputStr: 1112223333, strFormat: (xxx) xxx-xxxx
Output : (111) 222-3333
Please suggest if there are any utilities available? If not, best way to implement this problem?
Formatter, too.