How to replace white spaces with hyphen in data table?

HI @Sami_Rajput

Follow the below steps

  1. Read the excel sheet data in the DataTable variable name dt.
  2. Drag and drop the invoke code activity.
  3. In edit arguments, create a variable dt, set direction as in/out and pass value as dt.
  4. In edit code type the following,
dt.asenumerable.tolist.foreach(sub(row) row(“Column1”)= row(“Column1”).tostring.replace(“ ”,“-”))

Write the DataTable back into the excel using write range activity.

We have to use this inside invoke code as it does not produce a output.

Regards
Gokul

1 Like