Replace text to number

Hello,

i have the following case: my input date is “13 august 2024”,13 july 2024 etc. , i need to replace all mounts to number, like august to 8, july to 7 and etc.

What is the best approach to do that?

For example: 13 august 2024 to 13.08.2024 , 13 july 2024 to 13.07.2024 and etc.

Hi @adionisiev

Use this syntax:

Input = "13 august 2024"
Output = DateTime.ParseExact(Input,"dd MMMM yyyy",System.Globalization.CultureInfo.InvariantCulture).ToString("dd.MM.yyyy")

image

Hope it helps!!

we would recommend to parse it into a dateTime and reformat it as needed

Hi @adionisiev

Try this

Regards,