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

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -