If you want to delete all "", just use
System.String.Replace(string, string)
:
string myString;
myString = myString.Replace(@"""", string.Empty);
Please see:
http://msdn.microsoft.com/en-us/library/fk49wtc1.aspx[
^].
If you need to use some complex rule for removing quotation (which is often the case), learn and use
Regular Expressions using the class
System.Text.RegularExpressions.Regex
:
http://en.wikipedia.org/wiki/Regular_expressions[
^],
http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex.aspx[
^].
Please see my comment to the question. It's not clear how the question and your source code are related to the multidimensional arrays you declare. Probably, not related much.
Now, the bonus advice on reusing the dialog. Creating it from scratch all the time is bad, because you loose its position and all other aspects of its previous state. The most universal and robust approach is using
lazy evaluation pattern in its most primitive form:
http://en.wikipedia.org/wiki/Lazy_evaluation[
^].
Something like that:
public partial class MyMainForm {
OpenFileDialog openFileDialog;
OpenFileDialog OpenFileDialog {
get {
if (openFileDialog == null) { lazy initialization
openFileDialog = new OpenFileDialog();
}
return openFileDialog;
}
}
}
This is much better then doing it all in the construction of declaring class. With Forms, this is less of a problem, but with WPF, the problem is that such setup could be performed too early, when general UI is not yet properly initialized, so the lazy pattern is the absolute winner in all cases.
For more fun, you can get familiar with much more general (and I admit, maybe too esoteric) "wish you were here… only once" pattern I put forward myself:
Wish You Were Here… Only Once[
^]. :-)
—SA