Answers for "apex truncate string if it is longer"

0

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);
}
Posted by: Guest on May-14-2020

Code answers related to "apex truncate string if it is longer"

Browse Popular Code Answers by Language