Activity › Forums › Salesforce® Discussions › How to split a string by comma and single quotation mark in apex? Tagged: Quotation, Salesforce Apex, Salesforce SOQL Salesforce® Discussions How to split a string by comma and single quotation mark in apex? Posted by Himanshu on April 30, 2016 at 5:50 PM How to split a string by comma and single quotation mark in apex? Ravi replied 9 years, 11 months ago 2 Members · 1 Reply QuotationSalesforce ApexSalesforce SOQL 1 Reply Ravi Member May 25, 2016 at 6:45 AM Hi Himanshu, Try with this First remove all single quotes and then split by comma String str = ‘\’First Name\’,\’Last Name\’,\’Account Name\’,\’Email\’,\’Title\’,\’Description\”; System.debug(‘===str===’+str); for(String strFinal: str.replace(‘\”, ”).split(‘,’)) { System.debug(‘===Final val===’+strFinal); } Log In to reply. Public All Members My Connections Only Me PublicAll MembersMy ConnectionsOnly Me Public All Members My Connections Only Me