strrev

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2017 License: MIT Imports: 2 Imported by: 1

README

strrv

Build Status Codecov Go Report Card Go docs

Strrev is a package containing functions for reversing strings.

Why

The Go stdlib does not contain a string reversing function.

Go docs

Get the go docs at: godoc.org/4d63.com/strrev

Documentation

Overview

Package strrev exports functions for reversing strings.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Reverse

func Reverse(s string) string

Reverse reverses the given string, maintaining the bytes within any multibyte unicode characters in their existing order so that the character is still rendered correctly.

Example
package main

import (
	"fmt"

	"4d63.com/strrev"
)

func main() {
	r := strrev.Reverse("abcde丂g")

	fmt.Println(r)

}
Output:

g丂edcba

func ReverseBytes

func ReverseBytes(b []byte) []byte

ReverseBytes reverses the given byte slice, maintaining the bytes within any multibyte unicode characters in their existing order so that the character is still rendered correctly.

func ReverseCombining added in v1.1.0

func ReverseCombining(s string) string

ReverseCombining reverses the given string, maintaining the bytes within any multibyte and combining unicode characters in their existing order so that the character is still rendered correctly.

Example
package main

import (
	"fmt"

	"4d63.com/strrev"
)

func main() {
	r := strrev.ReverseCombining("abcdef\u0301\u031dg")

	fmt.Println(r)

}
Output:

gf̝́edcba

func ReverseCombiningBytes added in v1.1.0

func ReverseCombiningBytes(b []byte) []byte

ReverseCombiningBytes reverses the given byte slice, maintaining the bytes within any multibyte and combining unicode characters in their existing order so that the character is still rendered correctly.

Types

This section is empty.

Jump to

Keyboard shortcuts

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