RosettaCodeData/Task/Test-a-function/Ada/test-a-function-2.ada
2023-07-01 13:44:08 -04:00

5 lines
229 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))));