#regiontext box Specify position add carriage return characterPrivate voidButton1_Click (Objectsender, EventArgs e) { #region //Query the first letter position//string str = "Ab0ab0ab0ab0"; //int one = str. IndexOf ("0"); //returns the position "index" where 0 appears//for (int i=0;i<str. length;i++)//{ //One = str. IndexOf ("0", ++one); //the second occurrence of the position//if (one==-1)// { //Break ;//not found// } //MessageBox.Show (one. ToString ()); //} #endregion stringstr =TextBox1.Text.Trim (); intone = str. IndexOf ("</option>");//returns the position "index" where 0 appearsstr = str. Insert (one +9,"\ r \ n"); for(inti =0; I < Str. Length; i++) { One= str. IndexOf ("</option>", ++one);//the second occurrence of the position if(One = =-1) { Break;//not found } Else{str= str. Insert (one +9,"\ r \ n"); }} TextBox1.Text=str; } #endregion #regionList to string to remove text specified lineList<string> list =Newlist<string>(); Private voidButton2_Click (Objectsender, EventArgs e) {list. Clear (); // foreach(stringLineinchtextbox1.lines) {if(!line. Contains ("Select") ) {list. ADD (line); }} TextBox1.Text=string. Join ("\ r \ n", List. ToArray ()); } #endregion
C # traverse text box