# Tail does not retain an empty string
public class QQ { public static void main(String[] args) { String str = "a,b,c,d,"; String[] strArr = str.split(","); System.out.println(JSON.toJSON(strArr)); } }
# Retain the tail of an empty string
public class QQ { public static void main(String[] args) { String str = "a,b,c,d,"; String[] strArr = str.split(",", -1); System.out.println(JSON.toJSON(strArr)); } }