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

string - Using python and postgres, variables within execute function? -

python - Getting ESC characters and non-printables from UDP socket / buffer -