std::str: Add examples to the StrSlice trait.

Fixes #10819.
auto merge of #10824 : huonw/rust/str-doc, r=alexcrichton

Fixes #10819.