You need to sign in to do that
Don't have an account?

How to add list of CSV values into single string
Hi All,
I am unable to combine the list of values into single string.
Below code gives output as:
Csvfilebody'29682
','92367
','72661
','14768
','15031
','1158'
I need output as:
Endpoint: Csvfilebody'29682','92367','72661','14768','15031','1158'
I am unable to combine the list of values into single string.
Below code gives output as:
Csvfilebody'29682
','92367
','72661
','14768
','15031
','1158'
I need output as:
Endpoint: Csvfilebody'29682','92367','72661','14768','15031','1158'
String uploadCsv = csvFileBody.toString().trim(); System.debug('Csvfilebody'+uploadCsv); //uploadCsv:Csvfilebody29682 92367 72661 14768 15031 1158 List<String> uploadCSVlist = new List<String>(); uploadCSVlist = uploadCsv.split('\n'); List<String> csvFieldNames = new List<String>(); csvFieldNames = uploadCSVlist[0].split(','); List<String> sme = new List<String>(); string allstring; for(integer i=1;i<uploadCsvList.size();i++) { allString = allString+','+'\''+uploadCSVlist[i]+'\''; }
All Answers
It worked for me. Thank You!!