-9

I have a string like:

43965.96000,16933.986,404689.986,5814892.171,77.464,52.47585589,13.59670032,77.464,0.675,-0.223

I want to just keep the string which is bold in characters between commas. How can I do that?

Bharti
  • 13
  • 3

1 Answers1

0

To take your question literally, you could do write a method to split the string by comma and just take the element at the 5th index:

string ParseData(string data)
{
    return data.Split(',')[5];
}

So you'll be able to do something like:

string data = "43965.96000,16933.986,404689.986,5814892.171,77.464,52.47585589,13.59670032,77.464,0.675,-0.223";

string result = ParseData(data); // Result = "52.47585589"
Callum Evans
  • 331
  • 3
  • 18