replacer

package
v6.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MPL-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package replacer ...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Replacer

type Replacer struct {
	Source       []string
	Replacements []string
	EqFunc       func(string, string) bool
}

Replacer represents a string replacement operation.

func (Replacer) Replace

func (r Replacer) Replace() []string

Replace replaces strings in the Source slice with corresponding strings from the Replacements slice. It returns a new slice with the replaced strings, while leaving the original Source slice unchanged. The replacement is performed by iterating over the Source slice and checking if each element has a match in the Replacements slice. If a match is found, the corresponding element from the Replacements slice is used as the replacement.

Jump to

Keyboard shortcuts

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