Revert "use `substr` instead of `slice`"

This reverts commit 2e29f80615c44f35d70a1c2396639743746b3a04.