Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge: Palindrome Detector | Text Analysis & Simple Ciphers
C# Strings & Text Processing

bookChallenge: Palindrome Detector

Opgave

Swipe to start coding

Write a function that determines if a sentence is a palindrome, ignoring spaces, punctuation, and case.

  • Remove all characters from the input string that are not letters or digits.
  • Convert all remaining characters to lower case.
  • Check if the resulting string reads the same forward and backward.

The function must return true if the cleaned string is a palindrome, and false otherwise.

Løsning

Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 3. Kapitel 2
single

single

Spørg AI

expand

Spørg AI

ChatGPT

Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat

close

bookChallenge: Palindrome Detector

Stryg for at vise menuen

Opgave

Swipe to start coding

Write a function that determines if a sentence is a palindrome, ignoring spaces, punctuation, and case.

  • Remove all characters from the input string that are not letters or digits.
  • Convert all remaining characters to lower case.
  • Check if the resulting string reads the same forward and backward.

The function must return true if the cleaned string is a palindrome, and false otherwise.

Løsning

Switch to desktopSkift til skrivebord for at øve i den virkelige verdenFortsæt der, hvor du er, med en af nedenstående muligheder
Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 3. Kapitel 2
single

single

some-alt