Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

indent function (See related posts)

    indent: func [
        "Prepend a leader to all lines in a string."
        string [string!]
        /by
            amount [integer!]
        /with
            leader [string! char!]
        /local
            lines dent
    ] [
        if not by   [amount: 1]
        if not with [leader: " "]
        dent: mk-string amount leader
        lines: parse/all string form newline
        foreach line lines [insert line dent]
        build-dlm-str lines newline
    ]

You need to create an account or log in to post comments to this site.


Click here to browse all 5059 code snippets

Related Posts