Skip to content

findfirst instead of index? #193

@mattsignorelli

Description

@mattsignorelli

Why not use firstfirst here?

function index(str::AbstractString, substr::AbstractString)
ns = length(substr)
for ix in range(1, length(str)-ns+1)
if str[ix:ix+ns-1] == substr; return ix; end
end
return 0
end

Metadata

Metadata

Assignees

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