I have a text file that is formatted like so...
[Dimensions]
Height=100
Width=200
Depth=1000
I am trying to write a method that takes the parameter name such as "Height"
with the text and returns the value of the parameter but it is currently not working
public int getParameter(data, param) {
var start = data.IndexOf(param);
var end = data.IndexOf('\r\n', start);
return data.Substring(start + param.length + 1, end);
}
But it always returns partial text on the next line such as
"100\r\nWid"