Java tutorial
//package com.java2s; public class Main { public static String safeCharSeqToString(CharSequence cs) { if (cs == null) return "[null]"; else return cs.toString(); } }