Files
wjones af1152b001 Refactor: standardize namespace and using directive style
Refactored all C# test files to use explicit namespace declarations and moved all using directives inside the namespace block for consistency. Updated assembly info and cache files to reflect the new build. Adjusted MvcTestingAppManifest.json to use fully qualified assembly names. No functional changes; all updates are related to code style, organization, and project metadata.
2026-02-20 16:26:53 -05:00

42 lines
1.3 KiB
C#

// <copyright file="BaseExtensions.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace MediaBrowser.Common.Extensions
{
using System;
using System.Security.Cryptography;
using System.Text;
using System.Text.RegularExpressions;
/// <summary>
/// Class BaseExtensions.
/// </summary>
public static partial class BaseExtensions
{
// http://stackoverflow.com/questions/1349023/how-can-i-strip-html-from-text-in-net
[GeneratedRegex(@"<(.|\n)*?>")]
private static partial Regex StripHtmlRegex();
/// <summary>
/// Strips the HTML.
/// </summary>
/// <param name="htmlString">The HTML string.</param>
/// <returns><see cref="string" />.</returns>
public static string StripHtml(this string htmlString)
=> StripHtmlRegex().Replace(htmlString, string.Empty).Trim();
/// <summary>
/// Gets the Md5.
/// </summary>
/// <param name="str">The string.</param>
/// <returns><see cref="Guid" />.</returns>
public static Guid GetMD5(this string str)
{
#pragma warning disable CA5351
return new Guid(MD5.HashData(Encoding.Unicode.GetBytes(str)));
#pragma warning restore CA5351
}
}
}