c# - How can I turn a multi-line string into an array where each element is a line of said string? -


this question has answer here:

lets have

string str = @"line 1 line 2 line 3"; 

how can turn array 3 elements "line 1", "line 2" , "line 3".

use , removeemptyentries option remove empty lines text.

string[] splitted = str.split(new string[] {system.environment.newline}, stringsplitoptions.removeemptyentries); 

Comments

Popular posts from this blog

angular - DownloadURL return null in below code -

python 2.7 - Given three nested dictionaries, sort the top two nested dictionaries from a value in the innermost dictionary? -