I create the following for truncating a string in java to a new string with a given number of bytes.
String truncatedValue = \"\"; String curren
String s = "FOOBAR"; int limit = 3; s = new String(s.getBytes(), 0, limit);
Result value of s:
s
FOO