ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Extract string between two characters using SubString and RegularExpression in C#<p>Dear @Chand,&nbsp;</p> <p>Please refer below article</p> <p><a title="https://stackoverflow.com/questions/12108582/extracting-string-between-two-characters" href="https://stackoverflow.com/questions/12108582/extracting-string-between-two-characters" target="_blank">https://stackoverflow.com/questions/12108582/extracting-string-between-two-characters</a></p> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/174188/Extract-string-between-two-characters-using-SubString-and-RegularExpression-in-C/https://www.aspforums.net:443/Threads/174188/Extract-string-between-two-characters-using-SubString-and-RegularExpression-in-C/Tue, 27 Feb 2018 00:25:21 GMTExtract string between two characters using SubString and RegularExpression in C#<p>Try by below code if you string contain only one email details.</p> <pre class="brush: csharp">string testText = @&#34;&#34;&#34;riya vyas&#34;&#34; &lt;riyavyas1997@gmail.com&gt;&#34;; int startindex = testText.IndexOf(&#39;&lt;&#39;); int Endindex = testText.IndexOf(&#39;&gt;&#39;); string outputstring = testText.Substring(startindex + 1, Endindex - startindex - 1);</pre> <p>If its multiple then you can store it in string array variable like below.</p> <pre class="brush: csharp">string input = @&#34;&#34;&#34;xyz abc&#34;&#34; &lt;xyzabc2571997@gmail.com&gt;&#34;&#34;riya vyas&#34;&#34; &lt;riyavyas1997@gmail.com&gt;&#34;; string[] testing = Regex.Matches(input, @&#34;\&lt;(.+?)\&gt;&#34;) .Cast&lt;Match&gt;() .Select(s =&gt; s.Groups[1].Value).ToArray();</pre> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/174188/Extract-string-between-two-characters-using-SubString-and-RegularExpression-in-C/https://www.aspforums.net:443/Threads/174188/Extract-string-between-two-characters-using-SubString-and-RegularExpression-in-C/Tue, 27 Feb 2018 00:29:42 GMT