📜  如果字符串较长,则顶点截断字符串 - 任何代码示例

📅  最后修改于: 2022-03-11 14:55:17.644000             🧑  作者: Mango

代码示例1
String sizeString = 'Let\'s Imagine this is more than 120 Characters';
Integer maxSize = 120;
if(sizeString.length() > maxSize ){
    sizeString = sizeString.substring(0, maxSize);
}