HtmlFormattableString Class

An Microsoft.AspNetCore.Html.IHtmlContent implementation of composite string formatting (see https://msdn.microsoft.com/en-us/library/txafckwd(v=vs.110).aspx) which HTML encodes formatted arguments.

Namespace
Microsoft.AspNetCore.Html
Assemblies
  • Microsoft.AspNetCore.Html.Abstractions

Syntax

[DebuggerDisplay("{DebuggerToString()}")]
public class HtmlFormattableString : IHtmlContent
class Microsoft.AspNetCore.Html.HtmlFormattableString

Constructors

HtmlFormattableString(System.IFormatProvider, System.String, System.Object[])

Creates a new Microsoft.AspNetCore.Html.HtmlFormattableString with the given <em>formatProvider</em>, <em>format</em> and <em>args</em>.

Arguments:
  • formatProvider (System.IFormatProvider) – An object that provides culture-specific formatting information.
  • format (System.String) – A composite format string.
  • args (System.Object<System.Object>[]) – An array that contains objects to format.
public HtmlFormattableString(IFormatProvider formatProvider, string format, params object[] args)
HtmlFormattableString(System.String, System.Object[])

Creates a new Microsoft.AspNetCore.Html.HtmlFormattableString with the given <em>format</em> and <em>args</em>.

Arguments:
  • format (System.String) – A composite format string.
  • args (System.Object<System.Object>[]) – An array that contains objects to format.
public HtmlFormattableString(string format, params object[] args)

Methods

WriteTo(System.IO.TextWriter, System.Text.Encodings.Web.HtmlEncoder)
public void WriteTo(TextWriter writer, HtmlEncoder encoder)