How to get the length of a string using Apex in Salesforce? Biswajeet April 20, 2015 No Comments on How to get the length of a string using Apex in Salesforce? Sample Code: String str = 'biswajeet'; Integer i = str.length(); System.debug('size: ' + i)