RosettaCodeData/Task/Palindrome-detection/Slate/palindrome-detection-2.slate
2023-07-01 13:44:08 -04:00

6 lines
158 B
Text

s@(Sequence traits) isPalindrome
[
s isEmpty
ifTrue: [True]
ifFalse: [(s first = s last) /\ [(s sliceFrom: 1 to: s indexLast - 1) isPalindrome]]
].