MCPcopy Create free account
hub / github.com/microsoft/typescript-go / cutAny

Function cutAny

internal/jsnum/string.go:244–253  ·  view source on GitHub ↗
(s string, cutset string)

Source from the content-addressed store, hash-verified

242}
243
244func cutAny(s string, cutset string) (before, after string, found bool) {
245 if i := strings.IndexAny(s, cutset); i >= 0 {
246 before = s[:i]
247 afterAndFound := s[i:]
248 _, size := utf8.DecodeRuneInString(afterAndFound)
249 after = afterAndFound[size:]
250 return before, after, true
251 }
252 return s, "", false
253}
254
255func trimLeadingZeros(s string) string {
256 if strings.HasPrefix(s, "0") {

Callers 1

parseFloatStringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected