Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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+9 =