tuli
17th February 2019, 10:04
Hey,
I find myself often needing to find the index of a substring *after* the substring.
So I end up with this pattern a lot:
str.left(std.indexOf("something") + strlen("something"))
or
str.left(std.indexOf("something") + 9)
In one case I have to count chars by hand, in the other I have to duplicate the string.
Is there a better way to do it?
I find myself often needing to find the index of a substring *after* the substring.
So I end up with this pattern a lot:
str.left(std.indexOf("something") + strlen("something"))
or
str.left(std.indexOf("something") + 9)
In one case I have to count chars by hand, in the other I have to duplicate the string.
Is there a better way to do it?