(C#) удалить все после определенного символа в многострочном текстовом поле textbox1.text ?
Hello everyone. I wanted to remove everything after a specific character in each row in textBox1.Text multiline. This below is the code for remove everything after specific character, but for textBox single line: How to do it for textBox multiline? For example, before executing the code: www.page.1.com/page.2/page.3 www.home.page.net/about.page www.samepage.org/ www.text1.com/text2 I want it to look like this after executing the code: www.page.1.com www.home.page.net www.samepage.org www.text1.com Thank you.
Что я уже пробовал:
string str = textBox1.Text; if (str.Contains('/')) { int index = str.IndexOf('/'); string result = str.Substring(0, index); textBox1.Text = result; }