Lines Matching full:byte
5 // Package bytes implements functions for the manipulation of byte slices.
14 func equalPortable(a, b []byte) bool {
27 // up to a maximum of n byte slices. Invalid UTF-8 sequences are chopped into individual bytes.
28 func explode(s []byte, n int) [][]byte {
32 a := make([][]byte, n)
51 func Count(s, sep []byte) int {
82 func Contains(b, subslice []byte) bool {
87 func Index(s, sep []byte) int {
117 func indexBytePortable(s []byte, c byte) int {
127 func LastIndex(s, sep []byte) int {
142 func LastIndexByte(s []byte, c byte) int {
152 // It returns the byte index of the first occurrence in s of the given rune.
154 func IndexRune(s []byte, r rune) int {
166 // It returns the byte index of the first occurrence in s of any of the Unicode
169 func IndexAny(s []byte, chars string) int {
191 // points. It returns the byte index of the last occurrence in s of any of
194 func LastIndexAny(s []byte, chars string) int {
211 func genSplit(s, sep []byte, sepSave, n int) [][]byte {
223 a := make([][]byte, n)
244 func SplitN(s, sep []byte, n int) [][]byte { return genSplit(s, sep, 0, n) }
253 func SplitAfterN(s, sep []byte, n int) [][]byte {
261 func Split(s, sep []byte) [][]byte { return genSplit(s, sep, 0, -1) }
267 func SplitAfter(s, sep []byte) [][]byte {
273 func Fields(s []byte) [][]byte {
283 func FieldsFunc(s []byte, f func(rune) bool) [][]byte {
296 a := make([][]byte, n)
319 // Join concatenates the elements of s to create a new byte slice. The separator
321 func Join(s [][]byte, sep []byte) []byte {
323 return []byte{}
327 return append([]byte(nil), s[0]...)
334 b := make([]byte, n)
343 // HasPrefix tests whether the byte slice s begins with prefix.
344 func HasPrefix(s, prefix []byte) bool {
348 // HasSuffix tests whether the byte slice s ends with suffix.
349 func HasSuffix(s, suffix []byte) bool {
353 // Map returns a copy of the byte slice s with all its characters modified
357 func Map(mapping func(r rune) rune, s []byte) []byte {
363 b := make([]byte, maxbytes)
379 nb := make([]byte, maxbytes)
390 // Repeat returns a new byte slice consisting of count copies of b.
391 func Repeat(b []byte, count int) []byte {
392 nb := make([]byte, len(b)*count)
401 // ToUpper returns a copy of the byte slice s with all Unicode letters mapped to their upper case.
402 func ToUpper(s []byte) []byte { return Map(unicode.ToUpper, s) }
404 // ToLower returns a copy of the byte slice s with all Unicode letters mapped to their lower case.
405 func ToLower(s []byte) []byte { return Map(unicode.ToLower, s) }
407 // ToTitle returns a copy of the byte slice s with all Unicode letters mapped to their title case.
408 func ToTitle(s []byte) []byte { return Map(unicode.ToTitle, s) }
410 // ToUpperSpecial returns a copy of the byte slice s with all Unicode letters mapped to their
412 func ToUpperSpecial(_case unicode.SpecialCase, s []byte) []byte {
416 // ToLowerSpecial returns a copy of the byte slice s with all Unicode letters mapped to their
418 func ToLowerSpecial(_case unicode.SpecialCase, s []byte) []byte {
422 // ToTitleSpecial returns a copy of the byte slice s with all Unicode letters mapped to their
424 func ToTitleSpecial(_case unicode.SpecialCase, s []byte) []byte {
457 func Title(s []byte) []byte {
476 func TrimLeftFunc(s []byte, f func(r rune) bool) []byte {
486 func TrimRightFunc(s []byte, f func(r rune) bool) []byte {
499 func TrimFunc(s []byte, f func(r rune) bool) []byte {
505 func TrimPrefix(s, prefix []byte) []byte {
514 func TrimSuffix(s, suffix []byte) []byte {
522 // It returns the byte index in s of the first Unicode
524 func IndexFunc(s []byte, f func(r rune) bool) int {
529 // It returns the byte index in s of the last Unicode
531 func LastIndexFunc(s []byte, f func(r rune) bool) int {
538 func indexFunc(s []byte, f func(r rune) bool, truth bool) int {
557 func lastIndexFunc(s []byte, f func(r rune) bool, truth bool) int {
584 func Trim(s []byte, cutset string) []byte {
590 func TrimLeft(s []byte, cutset string) []byte {
596 func TrimRight(s []byte, cutset string) []byte {
602 func TrimSpace(s []byte) []byte {
607 func Runes(s []byte) []rune {
625 func Replace(s, old, new []byte, n int) []byte {
633 return append([]byte(nil), s...)
640 t := make([]byte, len(s)+n*(len(new)-len(old)))
663 func EqualFold(s, t []byte) bool {