是否有Visual C#方法来帮助解析奇怪的货币字符串?

问题描述:

我正在开发一个使用第三方csv文件作为输入并将各种值分配给字符串的应用程序。美元金额采用以下格式。 。



如果货币金额是负数,例如,($ 7685)



如果单数金额为正数,为$ 7685



我需要转换为双精度(用于计算)。在我开始尝试解析和转换之前,有没有什么方法可以让我的生活更容易解析/转换?



我感谢所有建议。

I'm working on an app that uses a 3rd party csv file as input and assigned the various values to strings. The dollar amounts are in the following format . .

if a monetary amount is a negative it is, for example, ($7685)

if the monitary amount is a positive, it is $7685

I will need to convert to a double (to use in calculations). Before I start trying to parse this and convert, are there any methods that would make my life easier in parsing/converting this?

I appreciate all suggestions.

7685)



如果单一金额为正数,则为
7685)

if the monitary amount is a positive, it is


7685



我需要转换为双(用于计算)。在我开始尝试解析和转换之前,有没有什么方法可以让我的生活更容易解析/转换?



我感谢所有建议。
7685

I will need to convert to a double (to use in calculations). Before I start trying to parse this and convert, are there any methods that would make my life easier in parsing/converting this?

I appreciate all suggestions.


您可能需要删除'