I have a multiple lookup field, and when I do this:

string myValue = oItem["MyLookupField"];

I get this string back:


or a real example:


as you can see not the most logical string to split. Surely there must be a better way to get a splitable string back from sharepoint for a lookup field.

I would expect something like:

"5;C3|15;P3" (for example)

Anyone know how to get a better string back for a lookup field?

3 Answers 3


Instead of parsing them manually, try using the SPFieldLookupValue class instead:

MSDN: SPFieldLookupValue

or the SPFieldMultiChoiceValue class:

MSDN: SPFieldMultiChoiceValue

  • I happen to have written an article on this very subject a few moments ago. :) tsstsst.com/?p=44
    – Stu Pegg
    Commented Aug 16, 2011 at 20:51

The delimiter cannot be changed and is found in the SPFieldMultiChoiceValue.Delimiter property.


you can write own function like this

var Result = Regex.Split(data, ";#", RegexOptions.ExplicitCapture) .ToList().aggregate((x,y)=>x+";"+y+"|");

This solve your problem

  • -1 For that to work you have to know the delimiter Commented Apr 13, 2011 at 10:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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