Update 10/8/2007 - This code is obsolete, as the SPFieldLookupValue object is a much better way to go
Here's some code that I use to get values out of a field in a SharePoint 2007 list since the id is sometimes imbedded into the value.
public static string ListValue(object listValue)
{
string[] splitter = new string[1];
splitter[0] = ";#";
if (listValue != null && listValue != string.Empty)
{
string[] checkListValue = listValue.ToString().Split(splitter,
StringSplitOptions.RemoveEmptyEntries);
if (checkListValue.Length > 1)
return checkListValue[1];
else
return checkListValue[0];
}
else
{
return string.Empty;
}
}