我有一个由 #
-value1#value2#value3#
等分隔的双类型值的长字符串
我把它分成了线桌。然后,我想把这个表中的每个元素都转换为 double 类型,结果得到一个错误。这里的类型转换有什么问题吗?
string a = "52.8725945#18.69872650000002#50.9028073#14.971600200000012#51.260062#15.5859949000000662452.23862099999999#19.372202799999250800000045#51.7808372#19.474096499999973#";
string[] someArray = a.Split(new char[] { '#' });
for (int i = 0; i < someArray.Length; i++)
{
Console.WriteLine(someArray[i]); // correct value
Convert.ToDouble(someArray[i]); // error
}