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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:29:14+00:00 2026-05-31T04:29:14+00:00

I have a string that goes like -23.45m / abc = 53.02m/s that I

  • 0

I have a string that goes like “-23.45m / abc = 53.02m/s” that I want to take apart. You’d think there was an easy way in .net to get the -23.45 (like using a built-in float interpreter) and tell me that the rest of the string starts at ‘m’.

In C++ I would use

double num;
wchar_t* input_text = L"-23.45m / abc = 53.02m/s";
if (swscanf(input_text, L"%lf%n", &num, &count) == EOF)
  return false;
pos += count;
  • 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-31T04:29:15+00:00Added an answer on May 31, 2026 at 4:29 am

    You could use a regular expression to match the double value at the start. You’ll need to consider what you want to support. For example, do you want to support all of these:

    • .5 (no digits before decimal separator)
    • +.5 (explicit +)
    • 15 (no decimal separator)
    • 1e-5 (scientific notation)
    • 1,000 (thousands separator)

    You should also consider what culture you want to parse in – “1,000” can mean “one thousand” or “one point zero zero zero” depending on your culture.

    Once you’ve got your specifications nailed down, writing a regex shouldn’t be too hard. That will let you match the double value in one capture and the rest of the string in another.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string sequence that goes like this: <x:object*10/> . I want to
I have a string that looks like this: 9/1/2009. I want to convert it
I have a dilemma that goes like this. I have a string that represents
I have a code that goes something like: $cipher_alg = MCRYPT_RIJNDAEL_128; $decrypted_string = mcrypt_decrypt($cipher_alg,
i have a string that looks like this: sodjfoisdfsdf sdofij sodiosifosf fsdi a123 sdfoi
I have a string that is UTC and would like to convert it to
I have a string that I want passed via the linebreaks filter. {% trans
If I have a line like this ContentRepository.Update(existing); that goes into datastore repository to
I have a .net application (c#) that goes something like this public partial class
I have a simple lambda expression that goes something like this: x=> x.Lists.Include(l =>

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.