I have Two Question Like, I tried this “now.ToString(“d-MM-yyyy”)” it gives output 3-2-2023. but question is will the Single d will give all the dates in a month? and single M will give the all Months like 1 to 12?
and if string is like only this 03-02-2023 then how to manipulate it so it will take only 3-2-2023 using string manipulation and regex?
The code uses a regular expression pattern to match any leading zero in the date string and replaces it with an empty string. The result will be a string in the format “3-2-2023”.