Remove 0 from the first index of a string

image

I want to remove 0 from the string. I want it like 2 but not 02. Moreover, these are dynamic values in a date format.

Eg. I want the date as 11/2/2020

Try Formatting the date using the ToString(“date format”)

The list of formats on this page will be useful:

Hi @Tanzill_Ahsan

You can try this in invoke code activitiy after reading the datatable and storing in dt1 using read range activitiy
(Make sure to tick the preserve format in the read range activitiy)

dt1.AsEnumerable().ToList().ForEach(Sub(row)
row (“Date”)=DateTime.ParseExact(row(“Date”).ToString,“MM/dd/yyyy”, System.Globalization.CultureInfo.InvariantCulture).ToString(“MM/d/yyyy”)))

Hope it helps

Mark it as solution if it resolves ur query

Regards

NIVED N :robot:

Happy Automation :relaxed::relaxed::relaxed:

Hi …@NIVED_NAMBIAR …I guess the .tostring should be MM/d/yyyy instead of MM/dd/yyyy. Right?

Hi @prasath17

Thanks for correcting my friend

I had corrected the response

Regards

Nived N :robot:

1 Like

thank you for your help but it is saying closing bracket expected

image

Hi @Tanzill_Ahsan

There is an extra bracket too which I had forget to.put

You can check my above response

Hope it helps you

Regards

Nived N :robot:

Happy Automation :relaxed::relaxed: