bytes package in go is used to implements functions for the manipulation of byte slices. It’s similar to the facilities of strings package.
Import bytes package in go:
import "bytes"
bytes package Functions
- Compare()
- Count()
- Fields()
- Index()
- IndexRune()
- LastIndexByte()
- Replace()
- SplitAfter()
- ToLowerSpecial()
- ToUpperSpecial()
- TrimLeft()
- TrimRightFunc()
- Contains()
- Cut()
- FieldsFunc()
- IndexAny()
- Join()
- LastIndexFunc()
- ReplaceAll()
- SplitAfterN()
- ToTitle()
- ToValidUTF8()
- TrimLeftFunc()
- TrimSpace()
- ContainsAny()
- Equal()
- HasPrefix()
- IndexByte()
- LastIndex()
- Map()
- Runes()
- SplitN()
- ToTitleSpecial()
- Trim()
- TrimPrefix()
- TrimSuffix()
- ContainsRune()
- EqualFold()
- HasSuffix()
- IndexFunc()
- LastIndexAny()
- Repeat()
- Split()
- ToLower()
- ToUpper()
- TrimFunc()
- TrimRight()
Types
type Buffer:
type Buffer functions
- NewBuffer()
- Grow()
- ReadByte()
- ReadString()
- UnreadByte()
- WriteRune()
- NewBufferString()
- Len()
- ReadBytes()
- Reset()
- UnreadRune()
- WriteString()
- Bytes()
- Next()
- ReadFrom()
- String()
- Write()
- WriteTo()
- Cap()
- Read()
- ReadRune()
- Truncate()
- WriteByte()
type Reader:
type Reader functions
- NewReader()
- ReadByte()
- Size()
- Len()
- ReadRune()
- UnreadByte()
- Read()
- Reset()
- UnreadRune()
- ReadAt()
- Seek()
- WriteTo()
To learn more about golang, Please refer given below link.
https://techieindoor.com/go-lang-tutorial/
References: