SPUtility.GetAccountName Method

Retrieves an account name, without provider information, given the full username associated with the account.

Namespace:  Microsoft.SharePoint.Utilities
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

Syntax

'Declaration
Public Shared Function GetAccountName ( _
    fullName As String _
) As String
'Usage
Dim fullName As String
Dim returnValue As String

returnValue = SPUtility.GetAccountName(fullName)
public static string GetAccountName(
    string fullName
)

Parameters

  • fullName
    Type: System.String

    The full username associated with the account.

Return Value

Type: System.String
A string that provides the account name for the account.

Remarks

If the provided username is empty or null, this method throws an exception of System.ArgumentNullException.

See Also

Reference

SPUtility Class

SPUtility Members

Microsoft.SharePoint.Utilities Namespace