Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string input = @"""abc"" <abc@gmail.com>; ""pqr"" <pqr@gmail.com>;";
- var output = String.Join(";", Regex.Matches(input, @"<(.+?)>")
- .Cast<Match>()
- .Select(m => m.Groups[1].Value));
- var regex = new Regex(@"<(.*?)>");
- var input= @"""abc"" <abc@gmail.com>; ""pqr"" <pqr@gmail.com>";
- var matches = regex.Matches(input);
- var res = string.Join(";", matches.Cast<Match>().Select(x => x.Value.Replace("<","").Replace(">","")).ToArray());
- string input = ""abc" <abc@gmail.com>; "pqr" <pqr@gmail.com>;";
- matchedValuesConcatenated = string.Join(";",
- Regex.Matches(input, @"(?<=<)([^>]+)(?=>)")
- .Cast<Match>()
- .Select(m => m.Value));
- string str = ""abc" <abc@gmail.com>; "pqr" <pqr@gmail.com>;";
- string output = string.Empty;
- while (str != string.Empty)
- {
- output += str.Substring(str.IndexOf("<") + 1, str.IndexOf(">") -1);
- str = str.Substring(str.IndexOf(">") + 2, str.Length - str.IndexOf(">") - 2).Trim();
- }
- private string GetEmailId(string input)
- {
- int start = input.IndexOf("<");
- int end = input.IndexOf(">");
- string result = input.Substring(start + 1, end - start - 1);
- return result;
- }
- string id = GetEmailId("'abc' <abc@gmail.com>");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement