Skip to content

find function for substring matching #421

Closed
@aman-godara

Description

@aman-godara

Description

Signature: find(string, pattern, start(Optional) = 1, end(Optional) = len(string), occurrence(Optional) = 1, consider_overlapping(Optional)= .true.)

Output: an integer (index)

Returns the index at which occurrence'th occurrence of substring pattern is present in the input string string
between the index start and end, if not found returns 0.
consider_overlapping: comment #1 & comment #2

Prior Art

Fortran has an intrinsic function index (description) which does the same thing but has limited features.

PS: Some of the features proposed above may not be best to add to the stdlib at this moment, hence there is also a need to discuss the importance of these features. They are added in the issue to bring them into the discussion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ideaProposition of an idea and opening an issue to discuss it

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions