mirror of
				https://github.com/theoludwig/programming-challenges.git
				synced 2025-09-11 23:11:21 +02:00 
			
		
		
		
	feat(solutions): add is-palindrome/cs/function
				
					
				
			This commit is contained in:
		
							
								
								
									
										3
									
								
								challenges/is-palindrome/solutions/cs/function/README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								challenges/is-palindrome/solutions/cs/function/README.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,3 @@ | ||||
| # is-palindrome/cs/function | ||||
|  | ||||
| Created by [@Divlo](https://github.com/Divlo) on 10 September 2021. | ||||
							
								
								
									
										26
									
								
								challenges/is-palindrome/solutions/cs/function/Solution.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								challenges/is-palindrome/solutions/cs/function/Solution.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,26 @@ | ||||
| using System; | ||||
|  | ||||
| namespace Solution | ||||
| { | ||||
|     class Program | ||||
|     { | ||||
|         static void Main() | ||||
|         { | ||||
|             string line = Console.ReadLine(); | ||||
|             line = line.ToLower().Replace(" ", ""); | ||||
|             string reverse = ""; | ||||
|             for (int index = line.Length - 1; index >= 0; index--) | ||||
|             { | ||||
|                 reverse += line[index]; | ||||
|             } | ||||
|             if (line == reverse) | ||||
|             { | ||||
|                 Console.WriteLine("true"); | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 Console.WriteLine("false"); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user