title: How to convert Mobile number to international format in C#
body: <p>I have to convert mobile number to International format.   </p>
  
  <p>ex: if user enters the number in below format:</p>
  
  <pre><code>0274 123 4567(Newzeland)
  09916123764(India)
  </code></pre>
  
  <p>Conversion should happen  </p>
  
  <pre><code>+642741234567 (Newzeland)
  +919916123764 (India)
  </code></pre>
  
  <p>Tried with lots of regular expressions, but just these are validating, but replace is not happening.</p>
  
  <p>Found some similar link in Stack overflow, but it's in Python.</p>
  
  <p><a href="https://stackoverflow.com/questions/21739475/formatting-a-mobile-number-to-international-format">Formatting a mobile number to international format</a></p>
  
  <p>For normal mobile validation i am using below code.</p>
  
  <pre><code>protected bool IsValidPhone(string strPhoneInput)
  {
      // Remove symbols (dash, space and parentheses, etc.)
      string strPhone = Regex.Replace(strPhoneInput, @"[- ()\*\!]", String.Empty);
  
      // Check for exactly 10 numbers left over
      Regex regTenDigits = new Regex(@"^([0|\+[0-9]{1,5})?([7-9][0-9]{9})$");
      Match matTenDigits = regTenDigits.Match(strPhone);
  
      return matTenDigits.Success;
  }
  </code></pre>
  
  <p>Could any body tell us how to convert this into C#.</p>