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.Fetch string from a string using SubString function in C# and VB.Net<p>Hi Chand,</p> <p>Check this example. Now please take its reference and correct your code.</p> <p><span style="text-decoration: underline;"><strong>Code</strong></span></p> <p><strong>C#</strong></p> <pre class="brush: csharp">protected void Page_Load(object sender, EventArgs e) { string str = &#34;i have String \&#34;Key \&#34;L\&#34; work On Wed, Apr 11, 2018 at 11:07 AM, &lt;ithelpdesk2571997@gmail.com&gt; wrote: &gt; Update By--&gt;Chandni, &gt; Description--&gt;Key \&#34;L\&#34; and \&#34;M\&#34; not work, &gt; Allocate To--&gt;Chandni, &gt; Status--&gt;open. &gt; &gt; &#34;; int index = str.IndexOf(&#34; On&#34;); string result = str.Substring(0, index); }</pre> <p><strong>VB.Net</strong></p> <pre class="brush: vb">Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load Dim str As String = &#34;i have String &#34;&#34;Key &#34;&#34;L&#34;&#34; work On Wed, Apr 11, 2018 at 11:07 AM, &lt;ithelpdesk2571997@gmail.com&gt; wrote: &gt; Update By--&gt;Chandni, &gt; Description--&gt;Key &#34;&#34;L&#34;&#34; and &#34;&#34;M&#34;&#34; not work, &gt; Allocate To--&gt;Chandni, &gt; Status--&gt;open. &gt; &gt; &#34; Dim index As Integer = str.IndexOf(&#34; On&#34;) Dim result As String = str.Substring(0, index) End Sub </pre> <p><strong><span style="text-decoration: underline;">Screenshot</span></strong></p> <p><strong><span style="text-decoration: underline;"><img src="https://i.imgur.com/5DijwNv.jpg" alt="" width="430" height="109" /></span></strong></p>https://www.aspforums.net:443/Threads/191139/Fetch-string-from-a-string-using-SubString-function-in-C-and-VBNet/https://www.aspforums.net:443/Threads/191139/Fetch-string-from-a-string-using-SubString-function-in-C-and-VBNet/Wed, 11 Apr 2018 06:02:16 GMT