~str -> StrBuf for replacement
Update doc tests for ~str -> StrBuf change.