Android String Format formatAccountNo(String accountNo)

Here you can find the source of formatAccountNo(String accountNo)

Description

format Account No

Declaration

public static String formatAccountNo(String accountNo) 

Method Source Code

//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;
        }
    }
}

Related

  1. format(String str, String[] obj)
  2. format(String str, Object... obj)
  3. format(String str, Object... args)
  4. simpleFormat(String s, Object aobj[])
  5. format(String str, Object... args)
  6. formattedNumber(String number)
  7. currentTime(CharSequence inFormat)
  8. formatIndent(String whiteSpace)
  9. formatNumberWithDecimals(Locale locale, String stringToFormat, int exactNumberOfDecimals)