public static String replaceIfFirstChar ( String s , char c , String replacement ) { return s . charAt ( 0 ) == c ? replacement + s . substring ( 1 ) : s ; }
Replaces the char c in the string S if it s the first character in the string .