We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
string sub --end
Would be neat if string sub --length accepted negatives indexes, just like string sub --start, e.g.
string sub --length
string sub --start
$ string sub --length -2 -- foobar foob
AFAIK, the only way to achieve this at the moment is:
$ set s foobar $ string sub --length (math (string length -- $s) - 2) -- $s foob
(Also, feel like this option should be (re?)named --end to match --start)
--end
--start
The text was updated successfully, but these errors were encountered:
That's an entirely different thing?
Like... with a length of 3, you'd go from a start of e.g. 2 to an end of 5.
Which is an okay thing to add, I just don't see why we should remove --length for it.
Sorry, something went wrong.
E.g. string sub --start 2 --length 3 foobar prints "oob" (a 3-long string starting with the second character).
string sub --start 2 --length 3 foobar
string sub --start 2 --end 3 foobar should print either oo or just o. (Arguably it'd be better to include the end, like we include the start, so oo)
string sub --start 2 --end 3 foobar
oo
o
Aha, misunderstood --length, got it!
--length
Successfully merging a pull request may close this issue.
Would be neat if
string sub --length
accepted negatives indexes, just likestring sub --start
, e.g.AFAIK, the only way to achieve this at the moment is:
(Also, feel like this option should be (re?)named
--end
to match--start
)The text was updated successfully, but these errors were encountered: