This commit is contained in:
Looly 2020-12-16 08:58:00 +08:00
parent a5be41c6a7
commit 990f1b5cc5

View File

@ -4146,7 +4146,7 @@ public class CharSequenceUtil {
if (null == str) {
return null;
}
if (str.length() <= maxLength) {
if (maxLength <= 0 || str.length() <= maxLength) {
return str.toString();
}
int w = maxLength / 2;