MCPcopy Create free account
hub / github.com/gobeam/stringy / ReplaceFirst

Method ReplaceFirst

stringy.go:287–290  ·  view source on GitHub ↗

ReplaceFirst takes two param search and replace. It returns string by searching search sub string and replacing it with replace substring on first occurrence it can be chained on function which return StringManipulation interface.

(search, replace string)

Source from the content-addressed store, hash-verified

285// sub string and replacing it with replace substring on first occurrence it can be chained
286// on function which return StringManipulation interface.
287func (i *input) ReplaceFirst(search, replace string) string {
288 input := getInput(*i)
289 return replaceStr(input, search, replace, First)
290}
291
292// ReplaceLast takes two param search and replace
293// it return string by searching search sub string and replacing it

Callers

nothing calls this directly

Calls 2

getInputFunction · 0.85
replaceStrFunction · 0.85

Tested by

no test coverage detected