Skip to content

Extra split effect option #6929

Closed
Closed
@3meraldK

Description

@3meraldK

Suggestion

As of now, Skript's split effect splits a text with limit set to -1 as shown here. Add an option to discard trailing empty lines, by simply changing the limit from -1 to 0.
Proposed syntax would look like: split %string% (at|using|by) [[the] delimiter] %string% [case:with case sensitivity] [with empty lines (discarded|removed|deleted)]

Why?

Sometimes it may be confusing for a user when they split a word at empty delimiter (""). The example word "test" split at "" spits out an array ["t", "e", "s", "t", ""]. When checking for length, a user expects it to be 4, while it is 5.

Other

No response

Agreement

  • I have read the guidelines above and affirm I am following them with this suggestion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    completedThe issue has been fully resolved and the change will be in the next Skript update.enhancementFeature request, an issue about something that could be improved, or a PR improving something.feature-readyA PR/issue that has been approved, tested and can be merged/closed in the next feature version.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions