Rust substring function?

And so given what @quadrupleslap and @DanielKeep said, the method I specified only works for char boundaries, most likely used on ones that are one byte long like

abcdefghijklmnopqrstuvwxyz(){}<>[]?:" etc

but not things like :smile: or :cloud: as they don't have a one byte size
Example and source of panic