title: Java Integer.ValueOf method equivalence in C# With Radix Parameter
body: <p>My task is to migrate this Java code to a C# version, but I'm having trouble with the <code>ValueOf</code> method, since I can't seem to find a equivalent version for C# (because of the <code>Radix</code> parameter used on Java, 16 in this case).</p>
  
  <pre><code>public String decrypt_string(String s) 
  {
    String s1 = "";
    int i = s.length() / 2;
    int[] ai = new int[i];
  
    for (int j = 0; j &lt; i; j++) 
    {
      // This is the "problematic" line \/
      ai[j] = Integer.valueOf(s.substring(j * 2, j * 2 + 2), 16).intValue();
    }
  
    int[] ai1 = decrypt_block(ai, i);
  
    for (int k = 0; k &lt; i; k++) 
    {
      if (ai1[k] != 0)
        s1 = s1 + (char)ai1[k];
    }
  
  return s1;
  </code></pre>
  
  <p>}</p>
  
  <p>Here is my try, but it failed:</p>
  
  <pre><code>public String decrypt_string(String s)
      {
          String s1 = "";
          int i = s.Length / 2;
          int[] ai = new int[i];
  
          for (int j = 0; j &lt; i; j++)
          {
              int startIndex = j * 2;
              string tmp = s.Substring(startIndex, 2);
              ai[j] = Int32.Parse (tmp); 
          }
  
          int[] ai1 = decrypt_block(ai, i);
  
          for (int k = 0; k &lt; i; k++)
          {
              if (ai1[k] != 0)
                  s1 = s1 + (char)ai1[k];
          }
          return s1;
      }
  </code></pre>
  
  <p>Thanks in advance</p>