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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:25:18+00:00 2026-06-07T00:25:18+00:00

Hi How do I retrieve the number from the following string, {number:100,data:[test]} The number

  • 0

Hi How do I retrieve the number from the following string,

{"number":100,"data":[test]}

The number could be of any length.

I used the following code. but it gives and error message

strValue.Substring((strValue.IndexOf(":")+1), (strValue.IndexOf("data")));

the output comes like

100,”data”:[

Thanks,

  • 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-07T00:25:21+00:00Added an answer on June 7, 2026 at 12:25 am

    As noted by Jon, your input string seems to be a JSON string which needs to be deserialized. You can write your own deserializer, or use an existing library, such as Json.NET. Here is an example:

    string json = @"[
      {
        ""Name"": ""Product 1"",
        ""ExpiryDate"": ""\/Date(978048000000)\/"",
        ""Price"": 99.95,
        ""Sizes"": null
      },
      {
        ""Name"": ""Product 2"",
        ""ExpiryDate"": ""\/Date(1248998400000)\/"",
        ""Price"": 12.50,
        ""Sizes"": null
      }
    ]";
    
    List<Product> products = JsonConvert.DeserializeObject<List<Product>>(json);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code to retrieve the result. var _label:Number = (data.ask -
I'm trying to retrieve only the version number out of a string, but the
I wrote the following code to retrieve data about stocks in the S&P 500.
I am using the following code to retrieve the user's phone numbers from the
I wish to retrieve a unique number every time I start my program (from
I have the following query that retrieve the number of users per country; SELECT
I can load a list with the following code String[] projection = new String[]
I am retrieving HTML from a remote host with the following jQuery code var
I use the following code to display list of contacts, and then retrieve contact
I currently have the following code to get a specific value i need from

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.