Documentation ¶
Overview ¶
Package slices 各种类型的切片.
包括 Runes, Strings, Int, Int64.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Runes ¶
type Runes []rune
Runes 切片.
Example ¶
package main import ( "fmt" "gitee.com/xuender/oils/slices" ) func main() { rs := slices.Runes{'a', 'c'} fmt.Println(rs.All('a', 'b')) fmt.Println(rs.Any('a', 'b')) fmt.Println(rs.Has('b')) fmt.Println(rs.Index('c')) fmt.Println(rs.Index('b')) fmt.Println(rs) }
Output: false true false 1 -1 a, c
type Strings ¶
type Strings []string
Strings 切片.
Example ¶
package main import ( "fmt" "gitee.com/xuender/oils/slices" ) func main() { s := slices.Strings{"a", "c"} fmt.Println(s[0]) fmt.Println(s[1]) fmt.Println(s.All("a", "b")) fmt.Println(s.Any("a", "b")) fmt.Println(s.Has("b")) fmt.Println(s.Index("c")) fmt.Println(s.Index("b")) fmt.Println(s) }
Output: a c false true false 1 -1 a, c
Click to show internal directories.
Click to hide internal directories.