Android String Trim nullsafeTrim(String str)

Here you can find the source of nullsafeTrim(String str)

Description

nullsafe Trim

Declaration

public static String nullsafeTrim(String str) 

Method Source Code

//package com.java2s;

import android.text.TextUtils;

public class Main {
    public static String nullsafeTrim(String str) {
        return TextUtils.isEmpty(str) ? str : str.trim();
    }/* w  w  w.  jav a2 s  . c om*/
}

Related

  1. trimStart(String s)
  2. trim(String str)
  3. trimToNull(String str)
  4. splitAndTrim(String str, String delims)
  5. trimEnd(String s)
  6. trimScheme(String uri)
  7. ltrim(final String text)
  8. ltrim(final String text, String trimText)
  9. rtrim(final String text)