Regex Error in currency
问题 I have a big problem, I used this codes to generate the number to currency, Dim reg = New Regex("\d+") Dim str As String = dZ.Rows(y).Item(14).ToString().Replace(",", ""). _ Replace(".00", "").Replace("$", "").Trim Dim match = reg.Match(str) If match.Success Then str = reg.Replace(str, Decimal.Parse(match.Value).ToString("C")) End If yes it works, but what if my amount is: 1,900.50 POC 回答1: kelvzy your solution is not very flexible. I will suggest my solution: string cellValue = dZ.Rows[y][14