Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8558695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:52:13+00:00 2026-06-11T15:52:13+00:00

When I get the list value from the Author column on a list in

  • 0

When I get the list value from the “Author” column on a list in SharePoint 2010, the following gets displayed:

2;#SP10Setup

Now the user that created that particular list item was “SP10Setup”, now is there a simple way to remove “2;#” at the beginning of SP10Setup without affecting the digits in “SP10Setup”?

I have a method that currently is stripping out all digits

//method to strip out unnecessary digits
public static string RemoveDigits(string key)
{

return Regex.Replace(key, @"\d", "");
}

this is how I get the particular list item value:

string author = listItem["Author"].ToString();

this is how I removed unwanted digits and characters:

//calling the RemoveCharacter method
string noDigitsAuthor = RemoveDigits(author);
string cleanedupAuthor = noDigitsAuthor.Replace(";", "").Replace("#", "");

The result I get from this is “SPSetup”, but ideally I would want the result to be “SP10Setup”.

What would be the quickest and easiest way to achieve this…

Thanks in Advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T15:52:15+00:00Added an answer on June 11, 2026 at 3:52 pm

    You should not do it yourself.
    Use SPFieldLookupValue class

    String author = "2;#SP10Setup";
    SPFieldLookupValue lookup = new SPFieldLookupValue(author);
    string cleanedupAuthor = lookup.LookupValue;
    int authorId = lookup.LookupId;
    

    so you will have:

    cleanedupAuthor = "SP10Setup"
    authorId = 2
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do I get the selected value from a dropdown list using JavaScript? <form>
I'm trying to select a value from a textbox that display a list of
In ASP.NET MVC, how can I get a selected dropdown list value from a
How to sort a list and get the initial index of a value in
How i can get value of checked radio button in radio button list.Here is
I am trying to get a list of values within a div that I
Using following code I try to get updated list of checkbuttons' corresponding text values,
Imagine that i have the following code: <a:repeat value=#{bean.getList()} var=x > <li class=la> <span>
Want to extract the text value from a lookup table's column in a db.
I have a button which I am using to add value from list 1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.