Method ExtString.Lines(+ 2 overloads)
Overload
Splits this string into lines.
public static string[] Lines(this string t, bool noEmpty = false, bool preferMore = false, bool rareNewlines = false)
Parameters
t (string)
This string. |
noEmpty (bool)
Don't need empty lines. |
preferMore (bool)
Add 1 array element if the string ends with a line separator or its length is 0. |
rareNewlines (bool)
If |
Returns
string[]
Array containing lines as strings. Does not include the last empty line, unless preferMore true. |
See Also
Overload(next)
Splits this string or a range in it into lines as start/end offsets.
public static StartEnd[] Lines(this string t, Range range, bool noEmpty = false, bool preferMore = false, bool rareNewlines = false)
Parameters
t (string)
This string. |
range (Range)
Range of this string. Example: |
noEmpty (bool)
Don't need empty lines. |
preferMore (bool)
Add 1 array element if the string range ends with a line separator or its length is 0. |
rareNewlines (bool)
If |
Returns
StartEnd[]
Array containing start/end offsets of lines in the string (not in the range). Does not include the last empty line, unless preferMore true. |
See Also
Overload(top)
Splits this string into lines as start/end offsets.
public static StartEnd[] Lines(this ReadOnlySpan<char> t, bool noEmpty = false, bool preferMore = false, bool rareNewlines = false)
Parameters
t (ReadOnlySpan<char>)
This string. |
noEmpty (bool)
Don't need empty lines. |
preferMore (bool)
Add 1 array element if the string span ends with a line separator or its length is 0. |
rareNewlines (bool)
If |
Returns
StartEnd[]
Array containing start/end offsets of lines. Does not include the last empty line, unless preferMore true. |