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 7571657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:43:33+00:00 2026-05-30T15:43:33+00:00

I am trying to retrieve the values of ‘Title’ using the following codes: private

  • 0

I am trying to retrieve the values of ‘Title’ using the following codes:

private void GetTweets_Click(object sender, RoutedEventArgs e)
    {
        WebClient client = new WebClient();

        client.DownloadStringCompleted += (s, ea) =>
        {
            XDocument doc = XDocument.Parse(ea.Result);
            XNamespace ns = "http://www.w3.org/2005/Atom";

            var items = from item in doc.Descendants(ns + "entry")
                select new Tweet()
                {
                    Title = item.Element(ns + "title").Value,

                    Image = new Uri((from XElement xe in item.Descendants(ns + "link")
                        where xe.Attribute("type").Value == "image/png"
                        select xe.Attribute("href").Value).First<string>()),
                };
            foreach (Tweet t in items)
            {
                _tweets.Add(t);
            }
        };

        client.DownloadStringAsync(new Uri("https://twitter.com/statuses/user_timeline/[username].atom?count=10"));
    }

I was able to retrieve a list of tweets, however, I want to remove the first 16 characters displayed by the ‘Title’ value.

Is there are way to use the sub string function here?
Thank you.

  • 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-05-30T15:43:34+00:00Added an answer on May 30, 2026 at 3:43 pm

    Assuming that item.Element(ns + "title").Value is a string, you should be able to use the String.Substring(Int32) method.

    Title = item.Element(ns + "title").Value.Substring(16),
    

    Be aware that this will throw an exception if the length of the Title is less than 16 characters, so it would probably be best to test for that first.

    Title = item.Element(ns + "title").Value.Length > 16 
            ? item.Element(ns + "title").Value.Substring(16) 
            : item.Element(ns + "title").Value,
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to retrieve the values from the following url: http://rentopoly.com/ajax.php?query=Bo . I
Using PHP. I'm trying to retrieve $_POST values from a the second dimension of
Trying out the following, will result in error. How do I retrieve the values
I am trying to retrieve values from Json Object but getting Exception.I am trying
I'm trying to retrieve values using VB.NET from a SQL database. How do I
I'm trying to retrieve odd values in a List of strings and convert them
I am trying to retrieve some values from the registry. Here is the full
I am trying to retrieve information from a web service call. The following is
I'm having some issues trying to retrieve unique values from a DataSet in csharp,
I am trying to retrieve query string values from a url. And the app

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.