Java tutorial
//package com.java2s; import android.text.TextUtils; public class Main { public static String RemoveLastZero(String datetime) { if (TextUtils.isEmpty(datetime)) return ""; if (datetime.length() > 19) return datetime.substring(0, 19); else return datetime; } }