Skip to content

Slice isn't dealing with short string as expected, sometimes #17

@magthe

Description

@magthe

This works as expected/documented

> (-> "012345678901234567890123456789" (superstring.core/slice 0 40))
"012345678901234567890123456789"
> (-> "012345678901234567890123456789" (superstring.core/slice 20 10))
"0123456789"

this doesn't

> (-> "012345678901234567890123456789" (superstring.core/slice 20 11))
Execution error (StringIndexOutOfBoundsException) at java.lang.String/checkBoundsBeginEnd (String.java:3720).
begin 20, end 31, length 30

I see the same behaviour on both openjdk8 and openjdk13 (ArchLinux).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions