I want to trim a string if the length exceeds 10 characters.
Suppose if the string length is 12 (String s=\"abcdafghijkl\"), then the new trimmed string
String s=\"abcdafghijkl\"
s = s.length() > 10 ? s.substring(0, 9) : s;