Removing invalid characters from price

前端 未结 7 604
臣服心动
臣服心动 2021-01-15 15:40

I have a scenario where I have to remove certain characters from a price string using C#.

I\'m looking for a regular expression to remove these characters or somethi

7条回答
  •  暖寄归人
    2021-01-15 16:21

    Why use a RegEx when a simple replace will do?

    string clean = "3,950,000 ( Ex. TAX )".Replace(" ( Ex. TAX )", string.Empty);
    

提交回复
热议问题