Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I want to retrieve the Url and the Description of a Hyperlink column in SP 2010 for data processing.

In the current scenario the field holds a link to an employee website as the URL and the name of the employee as the Description.

My only idea at this time is to use the following regex

^(?<URL>(https?://[\w@][\w.:@]+)\/?[\w\.?=%&=\-@/$,]*),\W(?<Description>.*)

So for a value like http://spd2010/firstname.lastname, Firstname Lastname

I get URL http://spd2010/firstname.lastname1 and Description Firstname Lastname

Is there any other way? It would be nice to know a best practice of some sort for this.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

SPFieldUrlValue is the class you are looking for.

This class exposes both the Url and the Description

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.