Add a new line at a specific position in a text file.
This will add the line where you want it. (Make sure you have using System.IO; and using System.Linq; added) public void CreateEntry(string npcName) //npcName = “item1” { var fileName = “test.txt”; var endTag = String.Format(“[/{0}]”, npcName); var lineToAdd = “//Add a line here in between the specific boundaries”; var txtLines = File.ReadAllLines(fileName).ToList(); //Fill a list … Read more