Here you can find the source of add(String str, int num)
public static String add(String str, int num)
//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(); } }