Venu_V
(Venu V)
1
Hello
My input is having the below format
input
2024-09-20 06:32:26.3603377
2024-09-20 06:33:39.4063317
2024-09-20 06:34:26.11096
i want my output like below
2024-09-20 06:32:26
2024-09-20 06:33:39
2024-09-20 06:34:26
basically need to trim that value after dot. PLEASE HELP ASAP
Thanks in advance
lrtetala
(Lakshman Reddy)
2
Hi @Venu_V
Try this
Code:
For Each row As DataRow In DT.Rows
row("DateColumn") = row("DateColumn").ToString().Split("."c)(0)
Next
Regards,
Hi @Venu_V,
Try with this:
System.Text.RegularExpressions.Regex.Replace(yourInput, “.\d+$”, “”)
lrtetala
(Lakshman Reddy)
4
@Venu_V
If your input is in string try like below
Input.Split(".")(0)
Regards,
Venu_V
(Venu V)
5
thank you very much it worked.
1 Like
SorenB
6
Hello @Venu_V
I would split the string and take index 0.
Assuming this is in a datatable, I would use:
For each row
Assign str_date = row("date").ToString.Split(".")(0)
Regards
Soren
system
(system)
Closed
7
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.