curious
0
Q:

apex truncate string if it is longer

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

New to Communities?

Join the community