ApiHelpers.cs 570 B

12345678910111213141516171819202122
  1. using System;
  2. namespace MediaBrowser.Model.ApiClient
  3. {
  4. public static class ApiHelpers
  5. {
  6. /// <summary>
  7. /// Gets the name of the slug.
  8. /// </summary>
  9. /// <param name="name">The name.</param>
  10. /// <returns>System.String.</returns>
  11. public static string GetSlugName(string name)
  12. {
  13. if (string.IsNullOrEmpty(name))
  14. {
  15. throw new ArgumentNullException("name");
  16. }
  17. return name.Replace('/', '-').Replace('?', '-').Replace('&', '-');
  18. }
  19. }
  20. }