Splitting the characters

my requirement is that to get a string from file path,i have done that
now, how to assign that string variable which was got from file path to path

iam getting the same error as above

can you share the input and expected output

@anjani_priya

closing stock as on 31st apr’ 2023
from above i have to get 31st apr’ 2023 in 31-04-2023 format

You can try this both 1 or 2

CDate(System.Text.RegularExpressions.Regex.Match(str_input,"\d{1,}(st|nd|rd|th)[A-Za-z\s*\’0-9]+").Value.Replace("st","").Replace("’","")).ToString("dd-MM-yyyy")
DateTime.ParseExact(System.Text.RegularExpressions.Regex.Replace(rc1, "(st)", ""), "dd MMM’yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd-MM-yyyy")

Note : in the APR month only 30 days will present not 31 please check that one

@anjani_priya

how to remove characters in it?

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.