Problem With Strings
<p>I am in a process of designing relational calculator.</p>

<p>If  a user supplied a string like -3.33+44*456/2.2-3+4....</p>

<p>I want to store it in string array as</p>

<p>-3.33</p>

<p>+44</p>

<p>*</p>

<p>456</p>

<p>/</p>

<p>2.2</p>

<p>-3</p>

<p>+4</p>

<p>......
(that is *, /, +ve value, -ve value separately and in serial order into an string array)</p>

<p>This is the code I wrote:</p>

<pre><code>string a = "-3.33+44*456/2.2-3";

string[] ip = new string[25];
        int k = 0;


            for (int i = 0; i &lt; a.Length; i++)
            {
                if (a.Substring(i, 1) == "+" || a.Substring(i, 1) == "-" || a.Substring(i, 1) == "*" || a.Substring(i, 1) == "/" || a.Substring(i, 1) == "^")
                {
                    for (int j = i + 1; j &lt; a.Length; j++)
                    {
                        if (a.Substring(j, 1) == "+" || a.Substring(j, 1) == "-" || a.Substring(j, 1) == "*" || a.Substring(j, 1) == "/" || a.Substring(j, 1) == "^")
                        {
                            if (a.Substring(i, 1) == "+" || a.Substring(i, 1) == "-")
                            {
                                ip[k] = a.Substring(i, j-i);
                                k++;
                            }
                            else
                            {
                                ip[k] = a.Substring(i, 1);
                                k++;
                                ip[k] = a.Substring(i + 1, (j -i)-1);
                                k++;
                            }
                            i = j;
                            break;
                        }
                    }
                }

            }
</code></pre>

<p>But its not working properly:
Its storing only one element in the array.</p>

<p>From last two days I am braking my head.
Please help me.
Thank You.</p>
