Hi,
I want to replace single quotes with double single quotes
ex: PSY’D with PSY’'D
This should replace from entire data table not on a particular column using UiPath.
Hi,
I want to replace single quotes with double single quotes
ex: PSY’D with PSY’'D
This should replace from entire data table not on a particular column using UiPath.
- Assign -> Input = "PSY'D"
- Assign -> Output = Input.Replace("'","''")
Check the below image for better understanding.
To change the single quote with double single quotes for a column in a datatable.
Take a for each row in datatable activity inside of this insert the assign activity.
- Assign -> Currentrow("Column name") = Currentrow("Column name").Replace("'","''")
Hope it helps!!
For Each row In dataTable.Rows
For Each col In dataTable.Columns
row(col) = row(col).ToString.Replace("'", "''")
Next
Next
A LINQ Approach
From r In dtData.AsEnumerable
let ra = r.ItemArray.Select(Function (x) x.ToString.Trim.Replace("'","''")).toArray()
Select dtCorrected.Rows.Add(ra)).CopyToDataTable()
Please check the below xaml
Input:
output:
Regards
This is working but the issue is when I am trying to push same in to database I am getting error , as it is not accepting single quotes.