strutil

package
v0.0.0-...-8462f15 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2014 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package strutil contains string and byte processing functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendSplitN

func AppendSplitN(dst []string, s, sep string, n int) []string

AppendSplitN is like strings.SplitN but appends to and returns dst. Unlike strings.SplitN, an empty separator is not supported. The count n determines the number of substrings to return:

n > 0: at most n substrings; the last substring will be the unsplit remainder.
n == 0: the result is nil (zero substrings)
n < 0: all substrings

func ContainsFold

func ContainsFold(s, substr string) bool

ContainsFold is like strings.Contains but uses Unicode case-folding.

func HasPrefixFold

func HasPrefixFold(s, prefix string) bool

HasPrefixFold is like strings.HasPrefix but uses Unicode case-folding.

func HasSuffixFold

func HasSuffixFold(s, suffix string) bool

HasSuffixFold is like strings.HasPrefix but uses Unicode case-folding.

func ParseUintBytes

func ParseUintBytes(s []byte, base int, bitSize int) (n uint64, err error)

ParseUintBytes is like strconv.ParseUint, but using a []byte.

func StringFromBytes

func StringFromBytes(v []byte) string

StringFromBytes returns string(v), minimizing copies for common values of v.

Types

This section is empty.

Jump to

Keyboard shortcuts

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