Skip to content

Commit bba2cb3

Browse files
authored
Update 542-data-delete.markdown
1 parent b283d16 commit bba2cb3

1 file changed

Lines changed: 10 additions & 14 deletions

File tree

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,23 @@
11
# DELETE
22

3-
> DELETE a, idx [, count]
3+
> DELETE A, idx [, count]
44
5-
Deletes 'count' elements at position 'idx' of array 'a'.
5+
Deletes `count` elements at position `idx` of array `A`.
66

7-
* a - An array-variable.
8-
* idx - Position in the array.
9-
* count - The number of the elements to be deleted.
10-
11-
Example 1: Delete element at position 2
7+
### Example 1: Delete element at position 2
128

139
```
14-
a = [1,2,3,4,5]
15-
print a
10+
a = [1, 2, 3, 4, 5]
11+
print a ' Output: [1,2,3,4,5]
1612
delete a, 2
17-
print a
13+
print a ' Output: [1,2,4,5]
1814
```
1915

20-
Example 2: Delete two elements starting at position 2
16+
### Example 2: Delete two elements starting at position 2
2117

2218
```
23-
b = [1,2,3,4,5]
24-
print b
19+
b = [1, 2, 3, 4, 5]
20+
print b ' Output: [1,2,3,4,5]
2521
delete b, 2, 2
26-
print b
22+
print b ' Output: [1,2,5]
2723
```

0 commit comments

Comments
 (0)