dartx
dartx copied to clipboard
Add String.splitAt(index)
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"