Documentation ¶
Overview ¶
Package strings provides some useful string manipulation functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Reverse ¶
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.
Click to show internal directories.
Click to hide internal directories.