stringreplacer

package
v0.0.0-...-df1b20f Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2018 License: Apache-2.0, BSD-3-Clause, MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Replacer

type Replacer struct {
	// contains filtered or unexported fields
}

Replacer replaces a list of strings with replacements. It is safe for concurrent use by multiple goroutines.

func NewReplacer

func NewReplacer(oldnew ...string) *Replacer

NewReplacer returns a new Replacer from a list of old, new string pairs. Replacements are performed in order, without overlapping matches.

func (*Replacer) Replace

func (r *Replacer) Replace(s string) string

Replace returns a copy of s with all replacements performed.

func (*Replacer) WriteString

func (r *Replacer) WriteString(w io.Writer, s string) (n int, err error)

WriteString writes s to w with all replacements performed.

Jump to

Keyboard shortcuts

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