Is there a simpler way of converting a two dimensional array in C#, such as [[1, 2, 3],[4, 5, 6]] into a string that says "[[1, 2, 3],[4, 5, 6]]", other than incrementing through each value and adding in the syntax manually?
I would like to use the array as an argument in my webView.ExecuteJavascript() method, which takes the method name string as an argument. Ideally, in C#, it would look like
webView.ExecuteJavascript("updateValues([[1, 2, 3],[4, 5, 6]])")
The updateValues function in javascript looks like this
updateValues(newvalues) {
oldvalues = newvalues
}
Would there be an easier way to do this? Right now, the results are stored in a list of double arrays (List), and calling .ToArray().ToString(), in a form such as this:
webView.ExecuteJavascript("updateValues(" + gaugeCol.ToArray().ToString() + ")");
only gives me the variable type and not the actual values.
Thanks