mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-23 11:32:07 +00:00
STRSUB and CHARSUB allow zero or negative positions
These are offsets from the end of the string, as if the STRLEN or CHARLEN respectively were added to the position. Fixes #812
This commit is contained in:
@@ -7,11 +7,14 @@ ENDM
|
||||
xstrsub "ABC", 1, 1
|
||||
xstrsub "ABC", 2, 1
|
||||
xstrsub "ABC", 3, 1
|
||||
xstrsub "ABC", -2, 1
|
||||
xstrsub "ABC", -1, 1
|
||||
xstrsub "ABC", 0, 1
|
||||
xstrsub "ABC", 1, 2
|
||||
xstrsub "ABC", 2, 2
|
||||
xstrsub "ABC", 2, 32
|
||||
xstrsub "ABC", 2, 300
|
||||
xstrsub "ABC", 0, 300
|
||||
xstrsub "ABC", -3, 300
|
||||
xstrsub "ABC", 4, 0
|
||||
xstrsub "ABC", 4, 1
|
||||
xstrsub "カタカナ", 1, 2
|
||||
|
||||
Reference in New Issue
Block a user