If you want to replace a text in other text, you can use Replace method
Replace method: Returns a new string in which all occurrences of a specified Unicode character or String in the current string are replaced with another specified Unicode character or String
C# Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
class Program { static void Main(string[] args) { string txt = "\"I love you the more in that I believe \n you had liked me for my own sake and for nothing else.\", John Keats\n"; string removedquote = txt.Replace("\"",""); Console.WriteLine(txt); Console.WriteLine(removedquote); Console.ReadLine(); } } |
Output: