Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Text.RegularExpressions;
- namespace Polindromes
- {
- class Polindromes
- {
- static void Main(string[] args)
- {
- string textStr = @"Nice blue sky. No exe flying in the sky. ABBA will not come in Bulgaria.
- I don`t know what is lamal, maybe I will find some day. mouseesuom";
- foreach (var word in Regex.Matches(textStr, @"\w*"))
- {
- string wordStr = Convert.ToString(word);
- for (int i = 0; i < (wordStr.Length/2); i++)
- {
- if (wordStr[i] != wordStr[wordStr.Length-i-1])
- {
- break;
- }
- else
- {
- if (i == (wordStr.Length/2)-1)
- {
- Console.WriteLine(wordStr);
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement