How do you check whether a string is palindrome or not using TCL script?
Answer Posted / nagendra prasath
proc palindrome {iStr} {
if {[ string match -nocase $iStr [string reverse $iStr]]} {
puts "Palindrome"
} else {
puts "Not a Palindrome"
}
}
palindrome "Sator Arepo Tenet Opera Rotas"
Palindrome
Is This Answer Correct ? | 18 Yes | 10 No |
Post New Answer View All Answers