SPUtility.FormatAccountName Method (String, String)

Validates the provider and user string values. If these strings are valid, this method concatenates the provider and user values in order, with a colon (":") between them, and returns the concatenated string.

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 FormatAccountName ( _
    provider As String, _
    user As String _
) As String
'Usage
Dim provider As String
Dim user As String
Dim returnValue As String

returnValue = SPUtility.FormatAccountName(provider, _
    user)
public static string FormatAccountName(
    string provider,
    string user
)

Parameters

  • provider
    Type: System.String

    A string that provides the name of the provider.

Return Value

Type: System.String
A concatenation of the provider and user strings, in order, separated by a colon (":").

Remarks

If either of the provider or user values is empty or null, this method throws an exception of System.ArgumentNullException. If the provider string contains a colon (":"), this method throws an error of System.ArgumentException.

See Also

Reference

SPUtility Class

SPUtility Members

FormatAccountName Overload

Microsoft.SharePoint.Utilities Namespace