patch 8.2.2344: using inclusive index for slice is not always desired

Problem:    Using inclusive index for slice is not always desired.
Solution:   Add the slice() method, which has an exclusive index. (closes
            #7408)
This commit is contained in:
Bram Moolenaar
2021-01-13 21:47:15 +01:00
parent c423ad77ed
commit 6601b62943
11 changed files with 106 additions and 28 deletions

View File

@ -619,6 +619,8 @@ String manipulation: *string-functions*
submatch() get a specific match in ":s" and substitute()
strpart() get part of a string using byte index
strcharpart() get part of a string using char index
slice() take a slice of a string, using char index in
Vim9 script
strgetchar() get character from a string using char index
expand() expand special keywords
expandcmd() expand a command like done for `:edit`
@ -648,6 +650,7 @@ List manipulation: *list-functions*
map() change each List item
mapnew() make a new List with changed items
reduce() reduce a List to a value
slice() take a slice of a List
sort() sort a List
reverse() reverse the order of a List
uniq() remove copies of repeated adjacent items