Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- namespace _06._Replace_Repeating_Chars
- {
- class Program
- {
- static void Main(string[] args)
- {
- string word = Console.ReadLine();
- string remove = RemoveDuplicateChars(word);
- Console.WriteLine(remove);
- }
- static string RemoveDuplicateChars(string word)
- {
- string result = "";
- foreach (char value in word)
- {
- if (result.IndexOf(value) == -1)
- {
- result += value;
- }
- }
- return result;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement