MCPcopy Index your code
hub / github.com/golang/example / String

Function String

hello/reverse/reverse.go:9–15  ·  view source on GitHub ↗

String returns its argument string reversed rune-wise left to right.

(s string)

Source from the content-addressed store, hash-verified

7
8// String returns its argument string reversed rune-wise left to right.
9func String(s string) string {
10 r := []rune(s)
11 for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {
12 r[i], r[j] = r[j], r[i]
13 }
14 return string(r)
15}

Callers 3

mainFunction · 0.92
ExampleStringFunction · 0.92
TestStringFunction · 0.85

Calls

no outgoing calls

Tested by 2

ExampleStringFunction · 0.74
TestStringFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…