splicing tested and documented
This commit is contained in:
parent
a0a8934a4f
commit
22115a2c6a
7 changed files with 72 additions and 30 deletions
|
|
@ -4,6 +4,8 @@ discard """
|
|||
456456
|
||||
456456
|
||||
Zugr5nd
|
||||
egerichtetd
|
||||
verichtetd
|
||||
'''
|
||||
"""
|
||||
|
||||
|
|
@ -41,3 +43,17 @@ echo()
|
|||
|
||||
echo mystr
|
||||
|
||||
mystr[4..4] = "u"
|
||||
|
||||
# test full replacement
|
||||
mystr[.. -2] = "egerichtet"
|
||||
|
||||
echo mystr
|
||||
|
||||
mystr[0..2] = "ve"
|
||||
echo mystr
|
||||
|
||||
var s = "abcdef"
|
||||
s[1 .. -2] = "xyz"
|
||||
assert s == "axyzf"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue