共用方式為


SPEncode.HtmlEncode method

使用於 HTML 的特殊字元編碼為 HTML 實體,請將編碼指定的字串。

Namespace:  Microsoft.SharePoint.Utilities
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'宣告
Public Shared Function HtmlEncode ( _
    str As String _
) As String
'用途
Dim str As String
Dim returnValue As String

returnValue = SPEncode.HtmlEncode(str)
public static string HtmlEncode(
    string str
)

參數

傳回值

Type: System.String
傳遞給此方法會將字串的編碼的版本。

備註

HtmlEncode方法將轉換成字元實體,如下所示:

  • < 至 & lt;

  • > 至 & gt ;

  • & 至 & 聊天室

  • "以 & quot ;

  • ' 至 & #39 ;

請參閱

參照

SPEncode class

SPEncode members

Microsoft.SharePoint.Utilities namespace