mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 18:18:37 +00:00
Polish Slice doc
This commit is contained in:
1 parent
be19f4eb91
commit
be82b5a94f
1 file changed
+3
-2
+3
-2
@@ -189,8 +189,9 @@ func compareGetFloat(a interface{}, b interface{}) (float64, float64) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Slicing in Slice is done by specifying a half-open range with
|
// Slicing in Slice is done by specifying a half-open range with
|
||||||
// two indices, lower and upper. 1 and 4 creates a slice including elements 1 through 3.
|
// two indices, start and end. 1 and 4 creates a slice including elements 1 through 3.
|
||||||
// The start and/or end indices can be omitted by setting one or both of them to -1; they default to zero and the slice's length respectively
|
// The start and/or end indices can be omitted by setting one or both of them to -1;
|
||||||
|
// they default to zero and the slice's length respectively
|
||||||
func Slice(a interface{}, start, end int) (string, error) {
|
func Slice(a interface{}, start, end int) (string, error) {
|
||||||
aStr, err := cast.ToStringE(a)
|
aStr, err := cast.ToStringE(a)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in new issue
Block a user