|
|
|
|
|
by LegionMammal978
685 days ago
|
|
What I find weird here is the asymmetry: Ruby apparently allows the end index to be out of range, but not the start index. Contrast with, e.g., Rust's slice syntax, where both endpoints have to be in range, or else it will cause a panic. |
|
What gives you that impression? "abc".slice(4, 10) is perfectly valid and accepted, assuming the code above is accurate.