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

  • Home
  • SEARCH
  • 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 6114247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:57:09+00:00 2026-05-23T14:57:09+00:00

Part of my app has an area where users enter text into a textBox

  • 0

Part of my app has an area where users enter text into a textBox control. They will be entering both text AND numbers into the textBox. When the user pushes a button, the textBox outputs its text into a string, finds all numbers in the string, multiplies them by 1.14, and spits out the typed text into a pretty little textBlock.

Basically, what I want to do is find all the numbers in a string, multiply them by 1.14, and insert them back into the string.

At first, I thought this may be an easy question: just Bing the title and see what comes up.

But after two pages of now-purple links, I’m starting to think I can’t solve this question with my own, very skimpy knowledge of Regex.

However, I did find a hearty collection of helpful links:

  • This article from DotNetPerls
  • This code snippet at Snipplr
  • This question on MSDN
  • This answer on StackOverflow
  • This article from AssociatedContent
  • This question on MSDN
  • This article on Java2s.com

Please note: A few of these articles come close to doing what I want to do, by fetching the numbers from the strings, but none of them find all the numbers in the string.

Example:
A user enters the following string into the textBox: “Chicken, ice cream, 567, cheese! Also, 140 and 1337.”

The program would then spit out this into the textBlock: “Chicken, ice cream, 646.38, cheese! Also, 159.6 and 1524.18.”

  • 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-23T14:57:10+00:00Added an answer on May 23, 2026 at 2:57 pm

    You can use a regular expression that matches the numbers, and use the Regex.Replace method. I’m not sure what you include in the term “numbers”, but this will replace all non-negative integers, like for example 42 and 123456:

    str = Regex.Replace(
      str,
      @"\d+",
      m => (Double.Parse(m.Groups[0].Value) * 1.14).ToString()
    );
    

    If you need some other definition of “numbers”, for example scientific notation, you need a more elaboarete regular expression, but the principle is the same.

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

Sidebar

Related Questions

Part of our company has moved to another area and they are being set
Part of our web app has a little Ajax method that will load a
I'm currently making an iPhone app that has PDF viewing a crucial part of
My app has the footer part which consist of 5 icons. These icons are
My PHP app has a number-crunching part that is just to slow for PHP,
I'm building a Facebook app that has (as part of its function) a display
Background I'm writing an part of my app that has no UI. It sits
Part of my app has a photo browser, somewhat similar to Apple's Photos app,
I have a single page app which has scrolling DIVs as part of the
I have a part of my app that has to save the current screenshot

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.