SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Created By Field Returns the following:

1073741823;#System Account

I want the following without string manipulation (i.e. without using substring to remove all of the characters before ";#"):

System Account

How can I do the above programmatically in a visual webpart?

string Author = item["Created By"].ToString(); 

The above is what I am currently using to get the author, but I want the login name to be the author

Any ideas on how I can achieve this?

I am fairly new to SharePoint and could really use the assistance.

share|improve this question
up vote 6 down vote accepted


SPFieldUserValue userValue = new SPFieldUserValue(web, item["Created By"].ToString());
string Author = userValue.LookupValue;
share|improve this answer
OMG THAT WORKED +1!!! I'll accept your answer when I'm allowed to. Thank you so much! – MyName Mar 14 '12 at 14:17

Your Answer


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.