Skip to content

Add String.splitAt(index) #177

Description

@passsy

Proposal:

Add a splitAt method to String extensions. This method splits a string into two parts at the specified index.

API:

List<String> splitAt(int index);

Example:

final result = "hello".splitAt(2);
// result: ["he", "llo"]

// Example with destructuring
final [firstPart, secondPart] = "hello".splitAt(2);
// firstPart: "he"
// secondPart: "llo"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions