How to get numbers from string in C#?
<pre><code>string str="this image has the width of 200px and height of 100px.";
int width, height;
</code></pre>

<p>How can I code to get </p>

<pre><code>width= 200;
height=100;
</code></pre>

<p>If width is more than 150, i will reduce the width to 150 and i will calculate the height</p>

<pre><code>if(width&gt;150)
{
 height=(height*150)/200;
 width=150;
}
</code></pre>

<p>And the result string would be..</p>

<pre><code>str="this image has the width of 150px and height of 75px.";
</code></pre>

<p>I know <code>substring()  indexOf() split()</code></p>

<p>I know i can split the string with "width" but I dunno how to find the number of that splitted string.</p>
