getFirstLine()function

getFirstLine(str: string): string
ParamType
strstring
The string to read the first line from. required
Return
string
The trimmed first line of str (everything before the first \n newline).

Get the (trimmed) first full line of a string.

Examples

getFirstLine("first\nsecond") // "first"