CopyTo
Copy to function will copy a specified number of characters from a specified position from the string to a specified position in an array of characters.
Example
string strcopyto = "Text with in myself will be searched"; Char[] destination = { 'M', 'h', 'e','r','t' };
strcopyto.CopyTo(1, destination, 2, 3); MessageBox.Show(destination[0].ToString() + destination[1].ToString() + destination[2].ToString() + destination[3].ToString() + destination[4].ToString() + destination[5].ToString());
Upper and Lower Case
To make a string as lower case or upper case we can use the ToLower and ToUpper functions
Example string strcopyto = "Text with in myself will be searched";
strcopyto.ToUpper(); strcopyto.ToLower(); To find the Length of the string
To get the length of the string using Length function
Example
string strcopyto = "Text with in myself will be searched";
strcopyto.Length;
To Insert a string
To insert a String at the specified position using Insert function.
Example
It will insert “hai” at the index of 2
strcopyto.Insert(2, "hai");
|
No responses found. Be the first to respond and make money from revenue sharing program.
|