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:


Qt Code:
  1. str.left(std.indexOf("something") + strlen("something"))
To copy to clipboard, switch view to plain text mode 

or

Qt Code:
  1. str.left(std.indexOf("something") + 9)
To copy to clipboard, switch view to plain text mode 


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?