SPUrlUtility.IsLegalFileName Method
Validates the specified URL leaf name.
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 IsLegalFileName ( _
name As String _
) As Boolean
'Usage
Dim name As String
Dim returnValue As Boolean
returnValue = SPUrlUtility.IsLegalFileName(name)
public static bool IsLegalFileName(
string name
)
Parameters
name
Type: System.StringThe leaf name to be validated.
Return Value
Type: System.Boolean
Returns a Boolean value of true if the specified leaf name is valid; otherwise, this method returns false.