Share via

SPUtility.AutoHyperlinking method

Converts URLs and email addresses in a plain text string into hyperlinks in an HTML-encoded string.

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


Public Shared Function AutoHyperlinking ( _
    value As String _
) As String
Dim value As String
Dim returnValue As String

returnValue = SPUtility.AutoHyperlinking(value)
public static string AutoHyperlinking(
    string value


Return value

Type: System.String
An HTML string containing an encoded version of the original string with embedded URLs and email addresses converted into hyperlinks.


This method searches for any URLs or email addresses in the specified string and converts them into HTML A tags.


The following example is part of a console application that converts a URL and an email address into two hyperlinks.

string plainText = "For more information on "Sample Product", see or e-mail";
string htmlText = SPUtility.AutoHyperlinking(plainText);

The example produces the following output:

For more information on &quot;Sample Product&quot;, see <a href=""></a> or e-mail <a href=""></a>.

See also


SPUtility class

SPUtility members

Microsoft.SharePoint.Utilities namespace