About c # intercepts string summary

protected  void  the Button1_Click ( Object  SENDER, EventArgs E) {      String  B = TextBox1.Text;       /// / taken first two 123a4a4b5b6 12 // string c = b.Substring (       0, 2); //TextBox1.Text = c; /// / taken after two // String 56 is C = 123a4a4b5b6 b.Substring (b.length - 2, 2); C = //TextBox1.Text;       /// / taken last character "a" behind 3 A4b characters // String C = 123a4a4b5b6 b.Substring (b.LastIndexOf ( "a"),. 3); //TextBox1.Text = C;       /// / intercept all last character "a" back 123a4a4b5b6 a4b5b6 String C = b.Substring // (b.LastIndexOf ( "A")); C = //TextBox1.Text;       //// Intercept the last character "a" in front of all the characters // String C = 123A4 123a4a4b5b6 b.Remove (b.LastIndexOf ( "a")); C = //TextBox1.Text;      /// / taken the last character " a "in front of all the characters // String C = 123A4 123a4a4b5b6 b.Substring (0, b.LastIndexOf (" a ")); C = //TextBox1.Text;       /// / taken the last character" preceding a "is 3 characters 123a4a4b5b6 123a4 3a4 // string c = b.Remove (b.LastIndexOf ( "a")); // string d = c.Remove (0, c.Length - 3); //TextBox1.Text = d ;      /// / taken last character "a" in front of the three characters 123a4a4b5b6 3a4 // string c = b.Substring (       2, b.LastIndexOf ( "a") - 2); //TextBox1.Text = c; /// / intercept the first character "b" in front of all the characters 123a4a4b5b6 123a4a4 // int index = b.IndexOf ( "b"); // string c = b.Substring (0, index); // TextBox1. Text = c;          //// Intercept the first character "b" in front of the three characters 123a4a4b5b6 4a4 // string c = b.Substring ( 0, b.IndexOf ( "b")); // string d = c.Substring (c.Length - . 3,. 3); D = //TextBox1.Text;      /// / interception of the first character "b" in front of the three characters 123a4a4b5b6 4a4 // string c = b.Substring ( b.IndexOf ( "b") - 3,3); //TextBox1.Text = C;       /// / interception of the first character "b" all of the characters behind 123a4a4b5b6 b5b6 // int index = b.IndexOf ( "b"); // string c = b.Substring (index, index-b.length); //TextBox1.Text = C;      ////// taken the first character "b" later three characters 123a4a4b5b6 b5b // int index = b.IndexOf ( "B"); // String b.Substring = C (index,. 3); //TextBox1.Text = C;        /// / removed from the beginning of the third three characters 123a4a4b5b6 1234b5b6 // string c = b .Remove (3, 3); //      TextBox1.Text = c;     //// B to remove all characters in the string; // String 123a4a4b5b6 123a4a456 b.Replace C = ( "b", ""); //TextBox1.Text = C;       /// / removing a first string characters 123a4a4b5b6 1234a4b5b6 // int index A = b.IndexOf ( "A",. 1); //b=b.Remove(index,. 1); B = //TextBox1.Text;       /// / removal string after the first character of a two 123a4a4b5b6 123a4b5b6 // int index = b.IndexOf (       "a", 1); // b = b.Remove (index, 2); //TextBox1.Text = b; /// / removal of the second character string a 123a4a4b5b6 123a4b5b6 // int index = b.IndexOf ( "a", 2); // b = b.Remove (index, 2); // TextBox1. B = the Text;       /// / removing the second character string after a two 123a4a4b5b6 123a4b5b6 // int index = b.IndexOf ( "a", 1); // b = b.Remove (index , 2); B = //TextBox1.Text;       //// Remove the last character in the string b 123a4a4b5b6 123a4a4b56 // int index = b.LastIndexOf ( "b"); // string c = b.Remove (b.LastIndexOf ( "b"), 1); // TextBox1 C = .text;       /// / after removal of the last character string of two b 123a4a4b5b6 123a4a4b5 // int index = b.LastIndexOf ( "b"); // string c = b.Remove (b.LastIndexOf ( "B"), 2); C = //TextBox1.Text;       /// / replacement string all the characters "a", of "b"; 123a4a4b5b6 123b4b4b5b6 // string c = b.Replace ( "a "," B "); //TextBox1.Text = C;       /// / replacement characters in the first character is a R 123a4a4b5b6 123R4a4b5b6 // int index = b.IndexOf (" a "); // string c b.Remove = (index,. 1) .Insert (index, "R & lt"); //TextBox1.Text = C;       //// Replace the last character of a character R 123a4a4b5b6 123a4R4b5b6 // int index = b.LastIndexOf ( "a"); // string c = b.Remove (index, 1) .Insert (index, "R"); C = //TextBox1.Text;        /// / I is inserted before the first a 123a4a4b5b6 123Ia4a4b5b6 // int index = b.IndexOf ( "a"); // string c = b.Insert (index, "I" ); //TextBox1.Text = C;       /// / I after first inserting a 123a4a4b5b6 123aI4a4b5b6 // int index = b.IndexOf ( "a"); // string c = b.Insert (index + 1 , "I"); //TextBox1.Text = C;       /// / I is inserted before a last 123a4a4b5b6 123a4Ia4b5b6 // int index = b.LastIndexOf ( "a"); // string c = b.Insert ( index, "I"); //TextBox1.Text = c; // I is inserted after the last a 123a4a4b5b6 123a4aI4b5b6 int index = b.LastIndexOf ( "a");    string c = b.Insert(index + 1, "I");     TextBox1.Text = c; }

Guess you like

Origin www.cnblogs.com/yxd000/p/12166966.html