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 -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -