Convert Comma Separated String to a List Using Apex

String name = 'Biswajeet, Abhijeet, Arijeet, Subhojeet';
List<String> lstName = name.split(',');
System.debug(lstName);

  • Ben Laor

    That does not convert it to a list, it just returns the first item in the comma separated string.

    • Check it once in your developer console.
      It is working fine.