Android examples for java.lang:String Replace
Remove Space from String
import android.util.Log; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main{ public static String delSpace(String str) { if (str != null) { str = str.replaceAll("\r", ""); str = str.replaceAll("\n", ""); str = str.replace(" ", ""); }/*from w w w. j ava 2s. co m*/ return str; } }