Skip to content

Commit f0718f5

Browse files
Update SliceTricks.md
Added one more delete trick
1 parent 415ec52 commit f0718f5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

SliceTricks.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ a = append(a[:i], a[j:]...)
4040
a = append(a[:i], a[i+1:]...)
4141
// or
4242
a = a[:i+copy(a[i:], a[i+1:])]
43+
// or
44+
copy(a[i:], a[i+1:])
45+
a = a[:len(a)-1]
4346
```
4447

4548
#### Delete without preserving order

0 commit comments

Comments
 (0)