String
Reverse a string in Rust
· ☕ 2 min read · 🤖 Naresh Mehta

Rust has been gaining a lot of positive attention in the developer community due to very many positive things. You can read more on Stackoverflow (https://stackoverflow.blog/2020/01/20/what-is-rust-and-why-is-it-so-popular/) so I will avoid repetition on this blog.

Rust has fantastic support for basic str primitive (https://doc.rust-lang.org/std/primitive.str.html) but there are typical things that are very hard to get a grip on when one jumps to Rust as a C/C++ developer. I was doing some exercisim.io for Rust and came across a nice exercise where a primitive str is passed to a function which is expected to return a Rust String with the contents reversed i.e. drawer as an input is reversed into reward as an out.