Home > Net >  C # filter string word at the custom
C # filter string word at the custom

Time:09-18



Str_telephone, for example, is the original data and the item is used to judge filter word according to
How do I get the str_telephone "throw & amp; nbsp; Investors "filter out?
The great god, help me

CodePudding user response:

1: string manipulation
2: regular expressions

CodePudding user response:

Use the replace is simpler,
String STR=str_telephone. Replace (" throw & amp; nbsp; Information ", "");

CodePudding user response:

The diagram below: left

Source left
 
using System;
using System.Collections.Generic;
Using System. Drawing;
Using System. Windows. Forms;

The namespace WindowsFormsApp1
{
Public partial class Form1: Form
{
Public _click ()
{
InitializeComponent ();
}
Private void button1_Click (object sender, EventArgs e)
{
String ri1=richTextBox1. Text;
String [] ri2List=richTextBox2. Text. The Split (' | ');
The foreach (var item in ri2List)
{
Ri1=ri1. Replace (item, "");
}
RichTextBox3. Text=ri1;
}
}
}

CodePudding user response:

If you want to good, you are filtering [cast & amp; have spent investors], or [investment], or filter, & amp; nbsp; HTML in the space of meaning is, according to the above code to filter [cast & amp; have spent capital] there is no problem, but if a [investment] you can't filter

CodePudding user response:

First & amp; nbsp; Replaced with Spaces;
Then put Spaces replaced with an empty string (that is, remove the Spaces);
Then filter "investment",
  •  Tags:  
  • C#
  • Related