Describe the bug
1..3 produces 3 numbers:
〉1..3
╭───┬───╮
│ 0 │ 1 │
│ 1 │ 2 │
│ 2 │ 3 │
╰───┴───╯
str substring 1..3 produces 2 characters:
〉"abcdefg" | str substring 1..3
bc
That's an unpleasant inconsistency.
How to reproduce
Use str substring with a range, observe that it produces 1 fewer character than there are numbers in the range.
Expected behavior
I expect that a range with n numbers should produce a string of n characters when used with str substring.
Screenshots
No response
Configuration
| key |
value |
| version |
0.74.1 |
| branch |
main |
| commit_hash |
b004aac |
| build_os |
windows-x86_64 |
| build_target |
x86_64-pc-windows-msvc |
| rust_version |
rustc 1.65.0 (897e37553 2022-11-02) |
| rust_channel |
1.65.0-x86_64-pc-windows-msvc |
| cargo_version |
cargo 1.65.0 (4bc8f24d3 2022-10-20) |
| pkg_version |
0.74.1 |
| build_time |
2023-01-12 12:55:53 -08:00 |
| build_rust_channel |
release |
| features |
database, default, trash, which, zip |
| installed_plugins |
|
Additional context
No response
Describe the bug
1..3produces 3 numbers:str substring 1..3produces 2 characters:That's an unpleasant inconsistency.
How to reproduce
Use
str substringwith a range, observe that it produces 1 fewer character than there are numbers in the range.Expected behavior
I expect that a range with
nnumbers should produce a string ofncharacters when used withstr substring.Screenshots
No response
Configuration
Additional context
No response