Share via


SPStringUtility.SubstringSurrogateAware method

Returns a substring of the specified string, ensuring that the returned string is valid if the string is a surrogate pair.

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

Syntax

'Declaration
Public Shared Function SubstringSurrogateAware ( _
    str As String, _
    startIndex As Integer, _
    length As Integer _
) As String
'Usage
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
)

Parameters

  • startIndex
    Type: System.Int32

    A 32-bit integer representing the index position of the start of the substring.

  • length
    Type: System.Int32

    A 32-bit integer representing the number of characters in the substring.

Return value

Type: System.String
The substring.

Remarks

Use the SubstringSurrogateAware method to split a surrogate pair and ensure that the returned substring is valid.

See also

Reference

SPStringUtility class

SPStringUtility members

Microsoft.SharePoint.Utilities namespace