Documentation ¶
Overview ¶
Package matrix 矩阵.
包括 Bytes.
Index ¶
- type Bytes
- func (x Bytes) All(elems ...[]byte) bool
- func (x Bytes) Any(elems ...[]byte) bool
- func (x *Bytes) Del(index int) Bytes
- func (x Bytes) Equal(elem Bytes) bool
- func (x Bytes) Has(r []byte) bool
- func (x Bytes) Index(r []byte) int
- func (x Bytes) Join(sep string) string
- func (x Bytes) Len() int
- func (x Bytes) Less(i, j int) bool
- func (x Bytes) String() string
- func (x Bytes) Swap(i, j int)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bytes ¶
type Bytes [][]byte
Bytes 字节码矩阵.
Example ¶
package main import ( "fmt" "sort" "gitee.com/xuender/oils/matrix" ) func main() { s := matrix.Bytes{[]byte("world"), []byte("hello")} fmt.Println(string(s[0])) fmt.Println(string(s[1])) fmt.Println(s.All([]byte("hello"), []byte("world"))) fmt.Println(s.Any([]byte("xxx"), []byte("hello"))) fmt.Println(s.Has([]byte("hello"))) fmt.Println(s.Index([]byte("world"))) fmt.Println(s.Index([]byte("xxx"))) sort.Sort(s) fmt.Println(s) }
Output: world hello true true true 0 -1 hello, world
Click to show internal directories.
Click to hide internal directories.