runes

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: BSD-3-Clause Imports: 2 Imported by: 4

README

runes

Package runes provides a small subset of functions that are found in strings, bytes standard packages, for rune slices. For rendering, and other logic, it is best to keep raw data in runes, and not having to convert back and forth to byte or string is more efficient.

These are largely copied from strings or bytes packages.

Documentation

Overview

Package runes provides a small subset of functions that are found in strings, bytes standard packages, for rune slices. For rendering, and other logic, it is best to keep raw data in runes, and not having to convert back and forth to byte or string is more efficient.

These are largely copied from strings or bytes packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EqualFold

func EqualFold(s, t []rune) bool

EqualFold reports whether s and t are equal under Unicode case-folding. copied from strings.EqualFold

func Index

func Index(txt, find []rune) int

Index returns the index of given rune string in the text, returning -1 if not found.

func IndexFold

func IndexFold(txt, find []rune) int

IndexFold returns the index of given rune string in the text, using case folding (i.e., case insensitive matching). Returns -1 if not found.

func Repeat

func Repeat(r []rune, count int) []rune

Repeat returns a new rune slice consisting of count copies of b.

It panics if count is negative or if the result of (len(b) * count) overflows.

Types

This section is empty.

Jump to

Keyboard shortcuts

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