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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T08:38:26+00:00 2026-06-09T08:38:26+00:00

I have a string string rx; and this string has the following type of

  • 0

I have a string string rx;
and this string has the following type of data: “v=123.111i=10.123r=1234\r\n”

So, what I want:
-have a 3 floating point(or some other decimal var) variables, “v” i” and “r”.
-scan the string… with a format string like “v=%.3fi=%.3fr=%.3f\r\n” where %.3f is the value (3 decimal digits)

  • 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-09T08:38:27+00:00Added an answer on June 9, 2026 at 8:38 am

    Use Regex and Double.Parse:

    var inputString = @"v=123.111i=10.123r=1234\r\n";
    
    foreach (Match match in Regex.Matches(inputString, @"\d+[.]?\d{3}"))
    {
        double result = Double.Parse(match.Value);
    }
    

    explain:

    \d+          digits (0-9) 
                 (1 or more times, matching the most amount possible)
    
    [.]?         character of: '.' 
                 (optional, matching the most amount possible)
    
    \d{3}        digits (0-9) 
                 (3 times)
    

    and I used Double.Parse. It converts the string representation of a number to its double-precision floating-point number equivalent.

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

Sidebar

Related Questions

I have some random string, let's say : s = This string has some
I have a string which has an xml inside. I want to write this
I have a variable that has this string: <DIV><SPAN style=FONT-FAMILY: Tahoma; FONT-SIZE: 10pt>[If the
For example, I have a string variable named str. This str has a value
I have a page that has 3 variables. They look like this: String[] Headers
I have a string: 'This is some random text so you don't get upset
I have a custom data type called StudentID , which has an implicit conversion
In my MySQL database, I have this Time data type as one of my
I have the following function that will convert a string into a numeric data
i have this string This is a <143>sample</143> regex <143>pa<665>t</665>tern</143> selection <143>by</143> tags in

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.