Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

palindrome

//Reverses every character in the string
func Reverse(s string) (result string){
	for _,v := range s {
	  result = string(v) + result
	}
	return 
    }

//Check if the string is same as it is reversed
func Check(s string) (b bool){
	a := Reverse(s)
	if s == a{
		b = true
	}else {
		b = false
	}
	return
}
Source by www.programiz.com #
 
PREVIOUS NEXT
Tagged: #palindrome
ADD COMMENT
Topic
Name
1+7 =