C# Substring Alternative - Return rest of line within string after character
<p>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 example of how the string/text file is laid out:</p>

<pre><code>...
part=XYZ
quantity=123
weight=14
length=60
...
</code></pre>

<p>Is there a good way to return everything after "=" on a given line?</p>

<p>I currently got it to work using substring, but I'm curious if there is a more concise way to get the same result. Here is the code I currently have:</p>

<pre><code>    strStart = partData.IndexOf("part=") + 5;
    strEnd = partData.IndexOf(" ", strStart);
    string partNum = partData.Substring(strStart, strEnd - strStart);
</code></pre>

<p><strong><em>Additional Clarification</em></strong></p>

<p>I will be extracting multiple variables from the text file. For example, given the data above I would extract the 4 variables:</p>

<p>partNum = "XYZ"</p>

<p>qty = "123"</p>

<p>wght = "14"</p>

<p>len = "60"</p>