zeek/testing/btest/Baseline/language.string-indexing/out
Jon Siwek 4014cdc277 Fix string slice notation, addresses BIT-1097.
Slice ranges were not correctly determined for negative indices and also
off by one in general (included one more element at the end of the
substring than what actually matched the index range).

It's now equivalent to Python slice notation.  Accessing a string at
a single index is also the same as Python except that an out-of-range
index returns an empty string instead of throwing an expection.
2013-12-03 14:39:21 -06:00

85 lines
363 B
Text

1
1
12345
0123456789
8
78
0123456789
2
1
word[-100] =
word[-7] =
word[-6] =
word[-5] = H
word[-4] = e
word[-3] = l
word[-2] = p
word[-1] = A
word[0] = H
word[1] = e
word[2] = l
word[3] = p
word[4] = A
word[5] =
word[6] =
word[7] =
word[100] =
A
1234
123
12
1
B
C
0123
01
012345
D
4
45
E
01234
01
012345
F
234
23
2345
F