IntHelper.cs 706 B

123456789101112131415161718192021
  1. using System.Globalization;
  2. namespace MediaBrowser.Model.Extensions
  3. {
  4. /// <summary>
  5. /// Isolating these helpers allow this entire project to be easily converted to Java
  6. /// </summary>
  7. public static class IntHelper
  8. {
  9. /// <summary>
  10. /// Tries the parse culture invariant.
  11. /// </summary>
  12. /// <param name="s">The s.</param>
  13. /// <param name="result">The result.</param>
  14. /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
  15. public static bool TryParseCultureInvariant(string s, out int result)
  16. {
  17. return int.TryParse(s, NumberStyles.Any, CultureInfo.InvariantCulture, out result);
  18. }
  19. }
  20. }