how do u reverse a given string in place code example
Example 1: reverse a string
let t = s.chars().rev().collect::<String>();
Example 2: reverse the string
#!/bin/bash
input="$1"
reverse=""
len=${#input}
for (( i=$len-1; i>=0; i-- ))
do
reverse="$reverse${input:$i:1}"
done
echo "$reverse"