I would like get the string in the formate of
2016-04-08 06:04:21 - elango - Comtag Added- Assigned to- sivaraman(E)- Email Notification Sent To karthik.47(E)- This is sample comtag for
esclation tsting
2016-04-08 06:08:37-sivaraman- Responded- Response Type:Executive Email Notification Sent To karthik.47(E)- This is for testing the edit loan
2016-04-08 06:22:24-Vinoth-Transferred To- sivaraman(E)- Response Type:Escalation Email Notification Sent To karthik.47(E)- Transfer to Siva
and store it in array using a Regex pattren, but i am getting the out put as,
""
2016-04-08 06:04:21
2016-04-08 06:04:21
- elango - Comtag Added- Assigned to- sivaraman(E)- Email Notification Sent To karthik.47(E)- This is sample comtag for
esclation tsting
esclation tsting
2016-04-08 06:08:37
2016-04-08 06:08:37
-sivaraman- Responded- Response Type:Executive Email Notification Sent To karthik.47(E)- This is for testing the edit loan
2016-04-08 06:22:24
2016-04-08 06:22:24
-Vinoth-Transferred To- sivaraman(E)- Response Type:Escalation Email Notification Sent To karthik.47(E)- Transfer to Siva
My code,
class Program
{
static void Main(string[] args)
{
string comment;
comment = "2016-04-08 06:04:21 - elango - Comtag Added- Assigned to- sivaraman(E)- Email Notification Sent To karthik.47(E)- This is sample comtag for
esclation tsting
2016-04-08 06:08:37-sivaraman- Responded- Response Type:Executive Email Notification Sent To karthik.47(E)- This is for testing the edit loan
2016-04-08 06:22:24-Vinoth-Transferred To- sivaraman(E)- Response Type:Escalation Email Notification Sent To karthik.47(E)- Transfer to Siva";
esclation tsting
2016-04-08 06:08:37-sivaraman- Responded- Response Type:Executive Email Notification Sent To karthik.47(E)- This is for testing the edit loan
2016-04-08 06:22:24-Vinoth-Transferred To- sivaraman(E)- Response Type:Escalation Email Notification Sent To karthik.47(E)- Transfer to Siva";
comment = "
" + comment;
" + comment;
string pattern = @"((((
|
)|(
|
))\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2})[a-zA-Z\s.,0-9@#$%*():;""'/?!+=_-]*)";
|
)|(
|
))\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2})[a-zA-Z\s.,0-9@#$%*():;""'/?!+=_-]*)";
string[] substrings = Regex.Split(comment, pattern, RegexOptions.Multiline);
foreach (var a in substrings)
{
Console.WriteLine(a);
}
Console.ReadLine();
}
}
Amit MohantyPosted Jul 26, 2019, 12:01 AM
", "
" };
Amit KumarPosted Jul 25, 2019, 11:38 PM
how
Are
you"; string[] delim = { "
" }; string[] spltd = str.Split(delim, StringSplitOptions.None);