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 -

meteor - inserting data to database gives error "insert failed: Method '/texts/insert' not found" -