Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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"
Source by www.cyberciti.biz #
 
PREVIOUS NEXT
Tagged: #reverse #string
ADD COMMENT
Topic
Name
2+4 =