Add ReadNormalizedString to XmlReaderExtensions

This commit is contained in:
Patrick Barron
2023-10-06 14:53:05 -04:00
parent 99832642ce
commit 8a7a1cc723
8 changed files with 112 additions and 372 deletions

View File

@@ -14,6 +14,18 @@ namespace MediaBrowser.Controller.Extensions;
/// </summary>
public static class XmlReaderExtensions
{
/// <summary>
/// Reads a trimmed string from the current node.
/// </summary>
/// <param name="reader">The <see cref="XmlReader"/>.</param>
/// <returns>The trimmed content.</returns>
public static string ReadNormalizedString(this XmlReader reader)
{
ArgumentNullException.ThrowIfNull(reader);
return reader.ReadElementContentAsString().Trim();
}
/// <summary>
/// Parses a <see cref="DateTime"/> from the current node.
/// </summary>