Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9066389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T16:43:14+00:00 2026-06-16T16:43:14+00:00

I have a Multi-Line text box that I can paste a list of any

  • 0

I have a Multi-Line text box that I can paste a list of any text items into, like this:

555-555-1212
I want's a lemon's.
google.com
1&1 Hosting

I also have a text box next to it that I can add comma separated strings that I want removed from all items in my list, like this:

-,$,!,@,#,$,%,^,&,*,(,),.com,.net,.org

I am trying to figure out how to scrub each of these strings(or whatever other strings I put in that second text box) from each of the strings in my textbox List.

Any ideas? I know how to get the List into a List-string, but not sure how to scrub that string.

This is what I have so far…but I am getting red squigglies:

List<string> removeChars = new List<string>(textBox6.Text.Split(','));                 
for (int i = 0; i < sortBox1.Count; i++)
{
    sortBox1[i] = Regex.Replace(sortBox1[i], removeChars, "").Trim();
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T16:43:15+00:00Added an answer on June 16, 2026 at 4:43 pm

    Use String.Replace on every string in the unwanted-list for every line in Textbox.Lines.

    string[] replaceStrings = txtUnwanted.Text.Split(',');
    List<string> lines = new List<string>(textBox1.Lines);
    for (int i = 0; i < lines.Count; i++)
        foreach (string repl in replaceStrings)
            lines[i] = lines[i].Replace(repl, "");
    

    Edit: here’s a demo: http://ideone.com/JQl79k (without windows controls since ideone doesn’t support it)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a multi-line TextBox that I can either type or paste items into.At
I have a multi-line text view that can get quite large. When the user
I have a multi line text box like : <asp:TextBox CssClass=txtform ID=txtWhom runat=server Height=78px
I have a multi line text box which is used to display the status
I have a multiline text box, and I'd like to display the user's current
I have to attach OnKeyPress event to the SharePoint multi-line column with text type
I have a simple program that i can open a webpage and i paste
I have a multiline textbox that contains very long text in it. How can
I have a multi-line textbox that typically displays very long strings (license agreements, for
I am trying to have a multi line textbox that when you type in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.