RosettaCodeData/Task/Test-a-function/Ada/test-a-function-2.ada
Ingy döt Net 6f050a029e update
2013-06-05 21:47:54 +00:00

5 lines
223 B
Ada

function Palindrome (Text : String) return Boolean
with Post => Palindrome'Result =
(Text'Length < 2 or else
((Text(Text'First) = Text(Text'Last)) and then
Palindrome(Text(Text'First+1 .. Text'Last-1))));