minor tut1 update
This commit is contained in:
parent
94f54700c4
commit
5824be8e8c
1 changed files with 3 additions and 3 deletions
|
|
@ -1325,11 +1325,11 @@ define operators which accept Slice objects to define ranges.
|
|||
b = "Slices are useless."
|
||||
|
||||
echo a[7..12] # --> 'a prog'
|
||||
b[11.. -2] = "useful"
|
||||
b[11..^2] = "useful"
|
||||
echo b # --> 'Slices are useful.'
|
||||
|
||||
In the previous example slices are used to modify a part of a string, and even
|
||||
a negative index is used. The slice's bounds can hold any value supported by
|
||||
In the previous example slices are used to modify a part of a string. The
|
||||
slice's bounds can hold any value supported by
|
||||
their type, but it is the proc using the slice object which defines what values
|
||||
are accepted.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue