String.trimLines
trimLines() -> string
Description
Remove all empty lines from the beginning and end of a string.
$text = ''' This is a multi-line string. ''' $text.trimLines() //= 'This is a\nmulti-line string.'
Remove all empty lines from the beginning and end of a string.
$text = ''' This is a multi-line string. ''' $text.trimLines() //= 'This is a\nmulti-line string.'