Skip to content

Split Based on Multiple Words #5931

@MohitVachhani

Description

@MohitVachhani

For example:

const input = "apple-orange banana_grape";
const result = _.split(input, ['orange', 'banana']); 
// Expected result: ['apple-', ' grape']

However, this approach doesn’t seem to work. Is there currently any functionality in Lodash that allows splitting a string by multiple words?

Use Case:
This feature would be valuable when parsing text or documents where specific words serve as delimiters, especially in data extraction and text processing scenarios.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions