it gave the below output:
td valign=âtopâ><img src=â/icons/back.gifâ alt=â[DIR]â
@som17 My bad, I guess there was an Editing problem , Try this : System.Text.RegularExpressions.Regex.Matches(holdline,â\d\d-\w+-\d{4}â)(0).ToString
still the same errorâŚ
@som17 Can you show us the Screenshot of the workflow where you have used this expression? Also it would be better if you would explain the process what you want to do and what you are currently doing, it will helps us to give the right solution
try this System.Text.RegularExpressions.Regex.Matches(dt,â\d\d-\w{3}-\d{4}â)(0).ToString
heyâŚi can share you the screenshot of XAMLâŚi am using while loop but u have used ForEach loop
@som17 I think you can use For Each Loop as I have implemented then, do the operations you want to do whatever you were performing in the while, the same in For Each, Also I didnât understand why you have used âholdline is Not Nothingâ as the Condition for While loop
because there might be the case that there is no data in the string
i actually used the foreach of matched inside while only and it gave correct outputâŚThanks for all the helpâŚ
@som17 But I do really think that whle loop is not needed, but if it is working for your case. It should be fine
You can directly get a DateTime
or another String
. Given my_string
your date stringâŚ
String
my_string = "03-May-2017 05:43"
As DateTime
DateTime
result = Convert.ToDateTime(my_string)
As String
String
format = "yyyy-MM-dd"
String
result =
Convert.ToDateTime(my_string).ToString(format)`
A Regex to get them all
With groups
\b(?<day>\d{2})-(?<month>Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(?<year>\d{4}) (?<hours>\d{2}):(?<minutes>\d{2})\b
Without groups
\b\d{2}-(?>Jan|Feb|Mar|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-\d{4} \d{2}:\d{2}\b
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.