Version: v0.7.0 - Beta.  We welcome contributors & feedback.

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.'

See Also