Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
program
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { class Program { public static bool IsPalindrome(string word) { int min = 0; int max = word.Length - 1; while (true) { if (min > max) { return true; } char a = word[min]; char b = word[max]; if (char.ToLower(a) != char.ToLower(b)) { return false; } min++; max--; } } static void Main() { string[] array = { "civic", "deleveled", "Hannah", "kayak", "level", "examiron", "racecar", "radar", "refer", "reviver", "easywcf", "rotator", "rotor", "sagas", "solos", "stats", "tenet", "Csharpstar", "" }; foreach (string value in array) { Console.WriteLine("{0} = {1}", value, IsPalindrome(value)); } } } } }
run
|
edit
|
history
|
help
0
Date example
RomaSlot2
a
hello-shared
Daily Coding Problem: Problem #1
bc160400236
gh
Array 10th grade
Selection sort c#
linked list (add to end and beginning, and looking for cycles based on Floyd's algorithm)