I have some code that reads a text file and sets it to a string. Each line of the text file contains separate data parameters that I a trying to extract. Here is an small ex
Yes, you can do it much more concisely.
string partNum = partData.Substring(partData.IndexOf("=") + 1);
This uses the overloaded version of String.Substring that only accepts one parameter, the starting position in the string. It continues from that point to the end of the string.
Clearly this only works if you're certain that there is equals sign in your partData
, but so would the original code you posted.