Skip to content

VDonC#ev

C{}d3

Categories

  • Abstract Data Structures
  • C# Algorithms
  • C# Snippets
  • Combinatorics
  • Java Algorithms
  • Java Snippets
  • Javascript Algorithms
  • PHP

Useful

  • Combinatorial Examples

MINI

Guess the number
Text 2 Array
Notepad

Recent Posts

  • Look And Say Sequence – PHP 7.4
  • Look and Say Sequence in PHP
  • Look and Say Sequence Generator – Javascript (ECMAscript 6)
  • Shortest Path In Graph – Dijkstra’s Algorithm – C# Implementation
  • Minimum Spanning Tree – Kruskal Algorithm – C# Implementation

Tag: palindromes

Easy way to find all palindromes inside string array using C#.

using System;
using System.Linq;

static class Palindromes
{
    private static void Main()
    {
        string[] words = { "test", "notPalindrome", "azuruza", "aha", "what?", "b" };
        Console.WriteLine(string.Join(", ", words.Where(w => w.SequenceEqual(w.Reverse()))));
    }
}
Posted on October 10, 2015December 1, 2019Categories C# SnippetsTags c#, find, Linq, palindromes, print, string array
Proudly powered by WordPress
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok