String Split method in Apex in Salesforce

2 thoughts on “String Split method in Apex in Salesforce

  • Hi,

    Hope you are doing well!

    How can i pass this. i have custom label which is having two email address and i need to pass this in toaddress. But i am getting an error like below

    Initial expression is of incorrect type, expected: String but was: List

    Code starts from:

    string toaddressList =label.ADM_Rm_OtherAdddress;
    String[] toaddresssplit =toaddressList.split(',');

    String[]toAddresses = new String[] {toaddresssplit};

Leave a Reply