Programming Tips - How can I make the first charater of a String lowercase but leave the rest untouched?

Date: 2016may19 Language: Java Keywords: lcFirst, ucFirst Q. How can I make the first charater of a String lowercase but leave the rest untouched? A.
String lcFirst(final String s) { if (s == null) return ""; String first = s.substring(0, 1); String remainder = ""; if (s.length() > 1) { remainder = s.substring(1); } return first.toLowerCase() + remainder; }
In javaScript:
function lcFirst(a) { if (a == null) return ''; return a.substr(0,1).toLowerCase() + a.substr(1); }