Jump to content

Palindrome detection: Difference between revisions

m
→‎{{header|R}}: Improved syntax.
m (→‎{{header|R}}: Syntax highlighting.)
m (→‎{{header|R}}: Improved syntax.)
Line 4,512:
 
Unicode is supported, but this ignores the "inexact palindromes" extra credit requirement because, without some sort of regex, supporting Unicode while stripping punctuation and white space is hard in R.
<lang rsplus>is.Palindrome <- function(string)
{
characters <- unlist(strsplit(string, ""))
all(characters == rev(characters))
}</lang>
{{out}}
331

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.