Android String Format simpleFormat(String s, Object aobj[])

Here you can find the source of simpleFormat(String s, Object aobj[])

Description

simple Format

Declaration

public static String simpleFormat(String s, Object aobj[]) 

Method Source Code

//package com.java2s;

public class Main {
    public static String simpleFormat(String s, Object aobj[]) {
        String as[] = s.split("%s");
        String s1;/*w w w. j av  a 2  s  .c om*/
        if (as.length < 2) {
            s1 = s;
        } else {
            StringBuilder stringbuilder = new StringBuilder();
            int i = aobj.length;
            int j = 0;
            do {
                int k = as.length;
                if (j >= k)
                    break;
                String s2 = as[j];
                StringBuilder stringbuilder1 = stringbuilder.append(s2);
                if (j < i) {
                    Object obj = aobj[j];
                    StringBuilder stringbuilder2 = stringbuilder
                            .append(obj);
                }
                j++;
            } while (true);
            s1 = stringbuilder.toString();
        }
        return s1;
    }
}

Related

  1. format(String str, String obj)
  2. format(String str, String[] obj)
  3. format(String str, Object... obj)
  4. format(String str, Object... args)
  5. format(String str, Object... args)
  6. formatAccountNo(String accountNo)
  7. formattedNumber(String number)
  8. currentTime(CharSequence inFormat)