happy new year !
I have collected data from an OPC UA server, the data is :
0;0;0;0;0;
I need to write this data to my OPC UA server, the good syntax need to be :
UInt16[] temp = { 0, 0, 0, 0, 0 };
How can I convert the first string to have my array of Uint16 ?
>Solution :
Using linq :
var dataString = "0;0;0;0;0;";
var temp = dataString.Split(';')
.Where(s => !s.Equals(string.Empty))
.Select(value => Convert.ToUInt16(value))
.ToArray();
