How do I generate the array of string pairs? I need it to quickly initialize it with static data.
stringPair[] arr = {{"hgh","hjhjh"},{"jkjk","kjhk"}
You can use list/array Tuple Class
Example
List<Tuple<string, string>> data = new List<Tuple<string, string>>{
new Tuple<string, string>("Hello", "World"),
new Tuple<string, string>("Foo", "Bar")
};
As per @Eric Lippert's comment, Use Tuple.Create
List<Tuple<string, string>> data = new List<Tuple<string, string>>{
Tuple.Create("Hello", "World"),
Tuple.Create("Foo", "Bar")
};
You can do something like this using mulitdimentional array:
string[,] arr = new string[,]{{"hgh","hjhjh"},{"jkjk","kjhk"}};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With