SPEncode.ScriptEncode method
將編碼的指令碼中使用的字串。
Namespace: Microsoft.SharePoint.Utilities
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'宣告
Public Shared Function ScriptEncode ( _
str As String _
) As String
'用途
Dim str As String
Dim returnValue As String
returnValue = SPEncode.ScriptEncode(str)
public static string ScriptEncode(
string str
)
參數
str
Type: System.String要編碼的字串。
傳回值
Type: System.String
在指令碼中使用的編碼的字串。
備註
ScriptEncode方法逸出字元,否則會產生衝突使用指令碼。下表所示,這個方法可讓字元取代項目。
原始 |
取代 |
---|---|
" |
\" |
+ |
\u002b |
\ |
\\ |
' |
\u0027 |
> |
\u003e |
< |
\u003c |