Java Utililty Methods String Cut

List of utility methods to do String Cut

Description

The list of methods to do String Cut are organized into topic(s).

Method

StringcutString(String str, int length, String charsetName)
cut String
int len = str.getBytes(charsetName).length;
if (len > length) {
    char[] chars = str.toCharArray();
    int i = 0;
    for (; i < chars.length; i++) {
        String tstr = new String(chars, 0, i + 1);
        if (tstr.getBytes(charsetName).length > length) {
            i--;
...