List of usage examples for java.lang String valueOf
public static String valueOf(double d)
From source file:Main.java
public static String getNewEventsFromCategoryUrl(String categoryId, long timestamp) { return KILLERBONE_FULL_URL + "events/" + categoryId + "/new/" + String.valueOf(timestamp); }
From source file:Main.java
/** * Returns a readable name of the current executing thread. *//*from ww w . j ava2s . c o m*/ public static final String currentThreadInfo() { Thread thread = Thread.currentThread(); return String.valueOf(thread.getName() + "@" + thread.hashCode()); }
From source file:Main.java
public static String[] getValueByGap(int max, int min, int gap) { ArrayList<String> list = new ArrayList<String>(); for (int i = min; i <= max; i += gap) { list.add(String.valueOf(i)); }//from www . ja va 2 s . c o m String[] s = new String[list.size()]; return list.toArray(s); }
From source file:Main.java
public synchronized static String getRandomCode(int length) { String sRand = ""; for (int i = 0; i < length; i++) { Random random = new Random(); String rand = String.valueOf(random.nextInt(10)); sRand += rand;// w w w. j a va 2s . co m } return sRand; }
From source file:Main.java
@SuppressLint("DefaultLocale") public static String getPriceString(double price) { BigDecimal a1 = new BigDecimal(Double.toString(price)); return String.valueOf(a1.doubleValue()); }
From source file:Main.java
public static String normalizeVerseInformation(Integer[] verseInfo) { if (verseInfo == null) { return null; }/*w w w . jav a 2 s .co m*/ String result = null; if (verseInfo.length > 0) { result = String.valueOf(verseInfo[0]); } if (verseInfo.length > 1 && verseInfo[1] != verseInfo[0]) { result += "_" + String.valueOf(verseInfo[1]); } return result; }
From source file:Main.java
public static String numberFormat(long number) { String numberString = String.valueOf(number); String returnString = ""; if (numberString.length() > 4) { returnString = numberString.substring(0, numberString.length() - 4); } else if (numberString.length() == 4) { returnString = numberString.substring(0, 1) + "," + numberString.substring(1, 4); } else {/*www . ja v a 2 s . c o m*/ returnString = numberString; } return returnString; }
From source file:Main.java
public static String cleanBlankToString(String des) { char[] chars = des.toCharArray(); StringBuffer sb = new StringBuffer(); for (Character c : chars) { if (java.util.regex.Pattern.matches("\\d", String.valueOf(c))) { sb.append(c);/*from w w w .ja v a 2s . c o m*/ } } return sb.toString(); }
From source file:Main.java
public static String byteArrayToString(byte[] paramArrayOfByte) { String str = ""; int i = paramArrayOfByte.length; for (int j = 0; j < i; j++) { int k = paramArrayOfByte[j]; str = str + String.valueOf(k); }//from ww w.j a v a2s . c om return str; }
From source file:Main.java
public static String getBinString(byte paramByte) { String str = ""; for (byte b = 0;; b++) { if (b >= 8) return str; int i = 0x1 & (0x80 & paramByte << b) >> 7; str = String.valueOf(str) + i; }//from w ww .j ava 2 s. c o m }