Hi,
i have a txt file with date in this format “26.04.2021”.
I need to change format to “26/04/2021”
It’s possible use Replace function with regular expression?
Thanks
Hi,
i have a txt file with date in this format “26.04.2021”.
I need to change format to “26/04/2021”
It’s possible use Replace function with regular expression?
Thanks
In the file i have other data, so i can’t replace “.” with “,”, but i need to use a regular expression to search date.
Hi @d_liberati
Try this
System.Text.RegularExpressions.Regex.Replace("20.12.2021", "(\d{2})\.(\d{2})\.(\d{4})", "$1/$2/$3")
for whole text use
System.Text.RegularExpressions.Regex.Replace(fullTextString, "(\d{2})\.(\d{2})\.(\d{4})", "$1/$2/$3")
This worked for me too
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.