MCPcopy Index your code
hub / github.com/bitfield/script / ExamplePipe_Replace

Function ExamplePipe_Replace

script_test.go:2533–2539  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2531}
2532
2533func ExamplePipe_Replace() {
2534 script.Echo("a\nb\nc\n").Replace("b", "replacement").Stdout()
2535 // Output:
2536 // a
2537 // replacement
2538 // c
2539}
2540
2541func ExamplePipe_ReplaceRegexp() {
2542 re := regexp.MustCompile("w.*d")

Callers

nothing calls this directly

Calls 3

EchoFunction · 0.92
StdoutMethod · 0.80
ReplaceMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…