feat(util): add string reverser

This commit is contained in:
2025-03-05 22:35:41 -03:00
parent 950dbee8a6
commit b5dd3faedc

12
utils/strings.go Normal file
View File

@@ -0,0 +1,12 @@
package utils
import "bytes"
func ReverseStringWithBuffer(input string) string {
var buffer bytes.Buffer
length := len(input) - 1
for i := length; i >= 0; i-- {
buffer.WriteByte(input[i])
}
return buffer.String()
}