0

std::String::find searches for a pattern in a String, and in particular can search for a substring.

I can't see an equivalent for general slices, or even (as I'm interested in) specifically &[u8] or Vec<u8>. Have I missed something obvious? It seems it would be an even easier thing to provide for &[u8] than for String when you don't need to worry about UTF-8. :-)

Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366
Chris Emerson
  • 13,041
  • 3
  • 44
  • 66
  • Thanks @Shepmaster; I tried things like "subslice" but not "subsequence". – Chris Emerson Oct 09 '16 at 15:56
  • Haha, me too! I *knew* there was a question about it already though, so I eventually found it. Now this question will get the all-important `subslice` keyword for search engines ;-) – Shepmaster Oct 09 '16 at 15:57

0 Answers0