strings

package
v0.0.0-...-818bd76 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package strings provides some useful string manipulation functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Reverse

func Reverse(s string) string

Reverse gives the reversed form of s.

This implementation improves performance by removing unnecessary string conversions. Further improvements could be made by:

1. Preallocating enough capacity in out. 2. Remove out and sort the input in place. 3. Use a specially designed type like strings.Builder from the stdlib. 4. Something much more complicated.

As mentioned in example3 this fails on combining characters like "noël". For a correct version see: http://rosettacode.org/wiki/Reverse_a_string#Go

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL