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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:04:41+00:00 2026-06-07T19:04:41+00:00

I want to find which Currency Symbol exists in Currency Format data. For example,

  • 0

I want to find which Currency Symbol exists in Currency Format data.

For example, Input String = $56.23

public class FormatConverter 
{
    private CultureInfo _cultureInfo;

    public void UpdateCultureInfo()
    {
        Thread.CurrentThread.CurrentCulture.ClearCachedData();
        var thread = new Thread(
            s => _cultureInfo = Thread.CurrentThread.CurrentCulture);

        thread.Start();
        thread.Join();
    }

    Bool TryParseCurrencySymbolAndValue(string input, out string CurrencySymbol,
                                        out double value)
    {
        if(_cultureInfo == null)
            UpdateCultureInfo();
        try{

        // Convert Currency data into double
        value = Double.Parse(input, NumberStyles.Number | NumberStyles.AllowCurrencySymbol);
        // How to extract Currency Symbol?
            CurrencySymbol = "$";
            return true;
        }
        catch(Exception ex){ /* Exception Handling */}
        return false;
    }
}

I want to extract “$” symbol from a string and 56.23 separately and then I want to apply CultureInfo to 56.23 into French Format. The output should be $56,23.

In some cases, input might be “Euro sign” or some other currency symbol in the beginning or in the end of input string.

I know how to convert into CurrentCulture for Numeric part. I don’t know how to extract currency Symbol from a string.

  • 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-07T19:04:42+00:00Added an answer on June 7, 2026 at 7:04 pm

    It sounds like you already know how to parse the string into a number type (correct me if I’m wrong). You’re using double in your example, I would suggest decimal but that’s your choice.

    To get the currency symbol you can use a simple regular expression

    Regex ex = new Regex(@"\p{Sc}");
    CurrencySymbol = ex.Match(input).Value;
    

    I hope that helps.

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

Sidebar

Related Questions

I want to find the Xelement attribute.value which children have a concrete attribute.value. string
I'm writing a WPF application in which i want to display the currency symbol
I want to find out which ip can be remote. (remote desktop) For example,
I have following string Class (102) (401) and Class (401) i want to find
I have following string Class (102) (401) and Class (401) i want to find
Given a class, org.eclipse.ui.views.navigator.ResourceNavigator for example, how do I find out which jar file
I want to find which tables are related to a specific table. I can
I have some numbers stored in a std::vector<int> . I want to find which
I want to find out which tables have been modified in the last hour
I want to find files in local directory which contain word: fgrep word *

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.