MCPcopy Create free account
hub / github.com/docopt/docopt.go / stringPartition

Function stringPartition

docopt.go:1218–1225  ·  view source on GitHub ↗
(s, sep string)

Source from the content-addressed store, hash-verified

1216}
1217
1218func stringPartition(s, sep string) (string, string, string) {
1219 sepPos := strings.Index(s, sep)
1220 if sepPos == -1 { // no seperator found
1221 return s, "", ""
1222 }
1223 split := strings.SplitN(s, sep, 2)
1224 return split[0], sep, split[1]
1225}
1226
1227// returns true if all cased characters in the string are uppercase
1228// and there are there is at least one cased charcter

Callers 5

parseDefaultsFunction · 0.85
parseOptionFunction · 0.85
parseLongFunction · 0.85
formalUsageFunction · 0.85
parseTestFunction · 0.85

Calls

no outgoing calls

Tested by 1

parseTestFunction · 0.68