I have a text file named hello.txt
with the following text:
[Hello] this is stack overflow and I Love [THIS] a lot. I use [Stack] for help.
I want just [ ]
(brackets string) in a listbox.
I tried:
using (StringReader reader = new StringReader(File Location))
{
string line;
while ((line = reader.ReadLine()) != null)
{
string input = line;
string output = input.Split('[', ']')[1];
MessageBox.Show(output);
}
}
But this doesn't work for me.