Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dedent() remove surrounding newlines #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Jul 31, 2020

  1. Dedent() removes surrounding newlines

    The most common use-case for Dedent() is a situation like:
    
        multiLineString = dedent.Dedent(`
            This is a
            multi-line string.
        `)
    
    Most programmers would reasonably expect multiLineString to be equal to
    `"This is a\nmulti-line string." Currently Dedent() returns `"\nThis is
    a\nmulti-line string.\n". When using raw string syntax, there is currently no good way to specify a multi-line string without a "\n". This commit strips a "\n" prefix and suffix, only if the string has both a "\n" prefix and a "\n" suffix.
    kindrowboat committed Jul 31, 2020
    Configuration menu
    Copy the full SHA
    4964896 View commit details
    Browse the repository at this point in the history