MCPcopy Create free account
hub / github.com/g3n/engine / StrInsert

Function StrInsert

text/str.go:48–52  ·  view source on GitHub ↗

StrInsert inserts a string at the specified character position

(s, data string, col int)

Source from the content-addressed store, hash-verified

46
47// StrInsert inserts a string at the specified character position
48func StrInsert(s, data string, col int) string {
49
50 start, _ := StrFind(s, col)
51 return s[:start] + data + s[start:]
52}
53
54// StrPrefix returns the prefix of the specified string up to
55// the specified character position

Callers 1

CursorInputMethod · 0.92

Calls 1

StrFindFunction · 0.85

Tested by

no test coverage detected