RosettaCodeData/Task/Palindrome-detection/LiveCode/palindrome-detection.livecode
2016-12-05 23:44:36 +01:00

16 lines
425 B
Text

function palindrome txt exact
if exact is empty or exact is not false then
set caseSensitive to true --default is false
else
replace space with empty in txt
put lower(txt) into txt
end if
return txt is reverse(txt)
end palindrome
function reverse str
repeat with i = the length of str down to 1
put byte i of str after revstr
end repeat
return revstr
end reverse