stringc

package
v0.0.0-...-f5c3557 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package stringc implements some strings extras

"stringc" is pronounced "strings".

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dedent

func Dedent(s string, n int) string

Dedent is the opposite of indent: it removes the given number of indents from each line. The indent style and width is assumed to be the total whitespace before the first non-whitespace character on the first line.

This is a shortcut from DedentPrefix(s, "", n)

func DedentPrefix

func DedentPrefix(s, prefix string, n int) (out string)

DedentPrefix is the opposite of indent: it removes the given prefix n number of times from each line.

func Indent

func Indent(s, prefix string) string

Indent prefixes each line of the given string with the given prefix.

func TrimLeftLines

func TrimLeftLines(s string) string

TrimLeftLines removes empty lines from the left of s.

func TrimLines

func TrimLines(s string) string

TrimLines removes empty lines from both the left and right of s.

func TrimRightLines

func TrimRightLines(s string) string

TrimRightLines removes empty lines from the right of s.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL