Suppose our JavaScript array is -
<script> var myArr = new Array(5); myArr[0] = "Welcome"; myArr[1] = "to"; myArr[2] = "the"; myArr[3] = "Web"; myArr[4] = "World"; </script>
Now, convert the array to string using comma as delimiter -
document.getElementById('demo1').value = myArr.join(',');
Now, will Bring it to C# -
string[] str = demo.Split(",".ToCharArray());
Convert JavaScript array to C#.
The above is the detailed content of How to convert JavaScript array to C# array?. For more information, please follow other related articles on the PHP Chinese website!