Android String Append add(String str, int num)

Here you can find the source of add(String str, int num)

Description

add

Declaration

public static String add(String str, int num) 

Method Source Code

//package com.java2s;

public class Main {
    public static String add(String str, int num) {
        int i = num;
        if (!isBlank(str)) {
            int intStr = Integer.parseInt(str);
            i = i + intStr;/*from   ww  w .j a va 2 s.c o  m*/
        }

        return Integer.toString(i);
    }

    public static boolean isBlank(String str) {
        if (null == str)
            return true;
        if ("".equals(str.trim()))
            return true;

        return false;
    }

    public static boolean isBlank(Long str) {
        if (null == str)
            return true;
        return false;
    }

    public static String toString(Object obj) {
        if (obj == null) {
            return "";
        }
        return obj.toString().trim();
    }
}

Related

  1. append(final String string, final String append, final String delimiter)
  2. addSuffix(String src, String suffix)
  3. appendStr(Object... strs)
  4. concat(Object... chunks)