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

Method Reverse

stringy.go:303–310  ·  view source on GitHub ↗

Reverse reverses the passed strings it can be chained on function which return StringManipulation interface

()

Source from the content-addressed store, hash-verified

301// Reverse reverses the passed strings
302// it can be chained on function which return StringManipulation interface
303func (i *input) Reverse() string {
304 input := getInput(*i)
305 r := []rune(input)
306 for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {
307 r[i], r[j] = r[j], r[i]
308 }
309 return string(r)
310}
311
312// Shuffle shuffles the given string randomly
313// it can be chained on function which return StringManipulation interface

Callers

nothing calls this directly

Calls 1

getInputFunction · 0.85

Tested by

no test coverage detected