I've a windows form with multiline text box. I'm trying to copy paste some data from excel sheet
I'm trying to split this values and add it to a string array using the below code
string[] languageList = language.Split('\n');
The output I'm getting is a single string
"c#javac++C"
instead of 4 strings, ie
languageList[0] = "c#"
languageList[1] = "java"
languageList[2] = "c++"
languageList[3] = "C"
Is there a way to split the excel row values using any delimiter?
"\n"is the line delimiter for Linux. Windows uses"\r\n". Better to write the code aslanguage.Split(new[] { System.Environment.NewLine });