uio
(uipath test)
1
Hey All,
I have an Excel file with mobile numbers in a column named “Mobile”.
As you can see in the screenshot attached below, all three rows are in different format.
How do I remove the prefixed zeros, spaces and any special characters ?
Thanks.
@uio
Try this Linq:
dtExcelData = (From row In dtExcelData.AsEnumerable()
Let mobileNumber = New String(row.Field(Of String)("Mobile")
.Where(Function(c) Char.IsDigit(c)).ToArray())
Select dtExcelData.Clone().LoadDataRow({mobileNumber}, False)
).CopyToDataTable()
Cheers…!
Yoichi
(Yoichi)
3
HI,
How about the following expression?
CurrentRow("Mobile") = System.Text.RegularExpressions.Regex.Replace(CurrentRow("Mobile").ToString,"\D","").TrimStart("0"c)
Regards,
system
(system)
Closed
4
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.