Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
Check if string is palindrome
//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) { //Your code goes here Console.WriteLine(IsPalindrome("Hello, world!")); } public static bool IsPalindrome(string value) { int min = 0; int max = value.Length - 1; while (true) { if (min > max) { return true; } char a = value[min]; char b = value[max]; if (char.ToLower(a) != char.ToLower(b)) { return false; } min++; max--; } } } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Reed Solomon Demo
PrecisionTester
TestApp
Weird behaiour of conditional operator
struc t
Calculadora
operatoru
transform string to hex code
Plt-D v.0.8.1
C# constructor in inheritance
Please log in to post a comment.