string data = "THExxQUICKxxBROWNxxFOX"; return data.Split(new string[] { "xx" }, StringSplitOptions.None);
Sonuç string[] şeklinde dizi olarak döner. Kelime veya harf ile metni bölme işlemi yapabilirsiniz.
Freelance Developer
string data = "THExxQUICKxxBROWNxxFOX"; return data.Split(new string[] { "xx" }, StringSplitOptions.None);
Sonuç string[] şeklinde dizi olarak döner. Kelime veya harf ile metni bölme işlemi yapabilirsiniz.
string fileName = @"C:\Temp\Mahesh.txt"; try { // Check if file already exists. If yes, delete it. if (File.Exists(fileName)) { File.Delete(fileName); } // Create a new file using (FileStream fs = File.Create(fileName)) { // Add some text to file Byte[] title = new UTF8Encoding(true).GetBytes("New Text File"); fs.Write(title, 0, title.Length); byte[] author = new UTF8Encoding(true).GetBytes("Mahesh Chand"); fs.Write(author, 0, author.Length); } // Open the stream and read it back. using (StreamReader sr = File.OpenText(fileName)) { string s = ""; while ((s = sr.ReadLine()) != null) { Console.WriteLine(s); } } } catch (Exception Ex) { Console.WriteLine(Ex.ToString()); }