Remove spaces from currency in datatable

Hi, I am receiving a datatable via excel. I am reading a range and then doing some work before writing to a final spreadsheet. One of my columns (number format) has some $ amounts with a space instead of comma (e.g. “1 203.23”.) This clearly creates a problem with the output to my end product file. Is there a way to remove spaces in a data column?

Yes you can achieve it. Use a foreach row and assign
row(“columnname”) = row(“columnname”).ToString.Replace(" “,”")

4 Likes

Worked perfectly. Thanks @vishal.kp!

1 Like

happy learning :slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.