language: C# (mono-2.8)
date: 152 days 22 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using System;
using System.Linq;
using System.Collections.Generic;
using System.Globalization;
 
public class Test
{
    
        public static void Main()
        {
            string txtUnwantedText = "-,$,!,@,#,$,%,^,&,*,(,),.com,.net,.org";
            string textBox1Lines = @"555-555-1212
I want's a lemon's.
google.com
1&1 Hosting";
 
            string[] replaceStrings = txtUnwantedText.Split(',');
            List<string> lines = new List<string>(textBox1Lines.Split(new[]{Environment.NewLine},StringSplitOptions.None));
            for (int i = 0; i < lines.Count; i++)
                foreach (string repl in replaceStrings)
                    lines[i] = lines[i].Replace(repl, "");
                    
            foreach(string line in lines)            
                Console.WriteLine(line);
 
        }
}