How can i write string data in excel in new line


i have data like below in my string


MAMODHOUSSEN, Bourhanoudine
EDMOND, Jordan
GOURDET, Guichna
i need to wite data like member as heading and other data in new line in excel like below

help me on same

Hi Mathkar,

You can use Split function and split the string using Environment.newline
For example,
If the input string name is strInput you have use strInput.Split(Environment.newline.ToCharArray)
You can then have a datatable, use forloop and add values in list to datatable
Then You can use Write range and write the data (Disable Add header Checkbox)

Hope this solution works for you!!

1 Like