Here you can find the source of filterString(String string)
Parameter | Description |
---|---|
string | a parameter |
public static String filterString(String string)
//package com.java2s; public class Main { /**//from w w w .ja v a 2 s.co m * * @param string * @return */ public static String filterString(String string) { if (isEmptyOrNull(string)) { return ""; } return string.trim(); } public static boolean isEmptyOrNull(String string) { if (string == null) { return true; } if (string.trim().length() == 0) { return true; } return false; } }