次の方法で共有


SPHttpUtility.HtmlEncodeAllowSimpleTextFormatting method

Encodes the specified string for use as text between HTML tags, preserving spaces in the original string and allowing simple text formatting.

Overload list

  Name Description
Public methodStatic member HtmlEncodeAllowSimpleTextFormatting(String) Encodes the specified string for use as text between HTML tags, preserving spaces in the original string and allowing simple text formatting.
Public methodStatic member HtmlEncodeAllowSimpleTextFormatting(String, TextWriter) Encodes the specified string for use as text between HTML tags, preserving spaces in the original string and allowing simple text formatting, and appends it to the specified output stream.

Top

Remarks

The HtmlEncodeAllowSimpleTextFormatting method:

  • Replaces ampersand, double-quotation, single-quotation, less-than, and greater-than characters with the appropriate entity references.

  • Replaces space characters preceded by a newline character or followed by another space character with " " entity references.

  • Replaces newline characters with HTML "<br>" tags.

  • Replaces carriage-return characters with space characters.

"<br>", "<b>", "<i>", "<u>", "</b>", "</i>", and "</u>" HTML tags and " " entity references in the specified string are permitted and not encoded. The allowed HTML tags and entity reference are case sensitive.

See also

Reference

SPHttpUtility class

SPHttpUtility members

Microsoft.SharePoint.Utilities namespace