Substring between characters in Salesforce using apex Biswajeet January 17, 2017 1 Comment on Substring between characters in Salesforce using apex Sample Code: String str1 = 'Hello'; String str2 = str1.substringBetween('H', 'o'); System.debug(str2); Output: