i have a datatable with contains currency column that needs to be validated and remove the ‘.’ and replace with ‘,’ as above stated, is there any linq query to do that. Instead of iterating and using regex to to the same?
I would like to replace the word as following, input is a string
Core Linq Query
//Iterating through actual table
//Adding rows to output table cloned from actual table
//Forming a new string array & Converting amount column string value to char array
New String(row("Amount").ToString.ToCharArray.Select(Function(c, index) _
//If the char is a symbol prior to last 3 digits it will replaced by comma else by a dot
If(index < row("Amount").ToString.Length-3, If(c.ToString.IsNumeric, c, ","c), If(c.ToString.IsNumeric, c, "."c))
nmnithinkrishna_DataTableColumnFormatUpdate.zip (2.5 KB)
Hope this helps.