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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:15:39+00:00 2026-05-25T11:15:39+00:00

In my application I download some data from website providing landscape informations like population,

  • 0

In my application I download some data from website providing landscape informations like population, landscape area and few more.

After parsing html code, data are stored in list of objects

public class Landscape
{
    public int Population { get; set; }
    public string Area { get; set; }
}

public List<Landscape> data;

No problem with that. Follows filling dataGrid and that’s purpose of my application. Now, where is the problem? Area info on the website is in semi-numeric, semi-string format. For example: 10 000 km2.

I have possibility to choose whether to trim km2 suffix and store data as int, or do nothing about it and store data as string. Since I want have data in dataGrid in original format, I decided not to trim.

Finally, is there a way to order rows (by size of area) as int although it is string type?

  • 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-25T11:15:39+00:00Added an answer on May 25, 2026 at 11:15 am

    You can use linq to sort by the translated value but don’t think this will be fast.

    public class Landscape
    {
        public int Population { get; set; }
        public string Area { get; set; }
    
        public int TrimAndConvert()
        {
            /* Your Code to trim and convert to int */
        }
    }
    
    
    data.OrderBy(landscape => landscape.Area.TrimAndConvert());
    

    I think a better way would be to save the Area as a number and add the trimmed part just for output.

    public class Landscape
    {
        public int Population { get; set; }
        public int AreaValue { get; set; }
        public string AreaUnit { get; set; }
    
        public string Area 
        {
            get 
            {
                return AreaValue.ToString() + AreaUnit;
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want my application to download some data from the internet, in iPhone SDK
I am trying to automate a download of some data from a web application
In my application I download some xml data file from some information center, add
I want to download some data in the application delegate in - application:didFinishLaunchingWithOptions: After
I'm making in house application that download data via xml files from external server.
We're building a commandline application that needs some data from the IIS server using
I'm working on an application that downloads some data from the internet using NSData's
My application lets users download their data as CSV files. These are supposed to
I have a desktop application that needs to upload/download images to/from service computer over
I'm working on an iPhone application that downloads data from a web server and

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.