Concatenate a List of Strings into a Single String Value Using Apex

Sample Code:

List<String> brandNameList = new List<String>{'Apple','Microsoft','Lenovo','Samsung','Sony'};
String allBrands = String.join(brandNameList,',');
system.debug('All Brands-' + allBrands);