Version: v0.8.1 - 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