Here you can find the source of formatAccountNo(String accountNo)
public static String formatAccountNo(String accountNo)
//package com.java2s; public class Main { public static String formatAccountNo(String accountNo) { try {/* w ww .j a va 2 s . c om*/ StringBuffer s = new StringBuffer(); for (int i = 0; i < accountNo.length() - 10; i++) { s.append("*"); } StringBuffer sb = new StringBuffer(accountNo); sb.replace(6, accountNo.length() - 4, s.toString()); return sb.toString(); } catch (Exception e) { return accountNo; } } }