Hi, I am trying to extract date and month from the current date. I have used string methods but i am getting below error. Can anyone help?
Output should be in the from : 28/02 (in this way)
I am getting the error : “LastIndexOf” is not declared, it may be inaccessible due to its protection level.
Hi @Sirisha_Siri
You can try with the below method!
dateString.Substring(0,5)
Regards
Yoichi
(Yoichi)
March 2, 2022, 6:52am
3
HI,
It should be as the following.
newdate.Substring(0,newdate.LastIndexOf("/"))
Regards,
1 Like
Hi @Sirisha_Siri
kindly use this expression
Datetime.ParseExact(MyDate, “dd/MM/yyyy”, System.Globalization.CultureInfo.InvariantCulture).ToString(“dd/MM”)
MyDate will be your input variable
Thankyou, how can i interchange month and date?
Ex : “Week of 02/28”
Thankyou, how can i interchange month and date?
Ex : “Week of 02/28”
Thankyou, how can i interchange month and date?
Ex : “Week of 02/28”
Convert.ToDateTime(“StringVariable”).ToString(“MM/dd”)
kindly use this @Sirisha_Siri
Gokul001
(Gokul Balaji)
March 2, 2022, 7:03am
9
Hi @Sirisha_Siri
Try the below expression
CDate(InputString).Tostring(“MM/dd”)
Regards
Gokul
Happy Automation @Sirisha_Siri
system
(system)
Closed
March 5, 2022, 7:05am
12
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.