共用方式為


SPStringUtility.SubstringSurrogateAware method

傳回指定的字串,確保傳回的字串有效的如果字串的 surrogate 字組的子字串。

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

Syntax

'宣告
Public Shared Function SubstringSurrogateAware ( _
    str As String, _
    startIndex As Integer, _
    length As Integer _
) As String
'用途
Dim str As String
Dim startIndex As Integer
Dim length As Integer
Dim returnValue As String

returnValue = SPStringUtility.SubstringSurrogateAware(str, _
    startIndex, length)
public static string SubstringSurrogateAware(
    string str,
    int startIndex,
    int length
)

參數

  • startIndex
    Type: System.Int32

    32 位元整數,表示子字串的開頭的索引位置。

  • length
    Type: System.Int32

    32 位元整數,表示子字串中的字元數目。

傳回值

Type: System.String
子字串。

備註

使用SubstringSurrogateAware方法來分割 surrogate 字組,並確認傳回的子字串有效。

請參閱

參照

SPStringUtility class

SPStringUtility members

Microsoft.SharePoint.Utilities namespace