Here you can find the source of nullsafeTrim(String str)
public static String nullsafeTrim(String str)
//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*/ }