Skip to content

string.slice negative end index is not shifted #814

@ark120202

Description

@ark120202

Input:

console.log('abcd'.slice(1, -1)); // => "bc"

Current Result:

print(
    string.sub("abcd", 2, -1) -- => "bcd"
)

Expected Result:

print(
    string.sub("abcd", 2, -2) -- => "bc"
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions