KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a long string with double-type values separated by # - value1#value2#value3# etc I splitted it to string table. Then, I want to convert every single element from this table to double type and I get an error. What is wrong with type-conversion here? 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 }
Tags (comma-separated)
Save Edits
Cancel