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.Call String method inside another in C# and VB.Net<p>Hi <a class="username" rel="SUJAYS"> SUJAYS</a>,</p> <p>Please refer below sample.</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 message = &#34;Mudassar Khan&#34;; Response.Write(&#34;Length of &lt;b&gt; &#34; + message + &#34;&lt;/b&gt; is : &lt;b&gt; &#34; + GetLength(message) + &#34;&lt;/b&gt;&#34;); } public int GetLength(string name) { return GetString(name).Length; } public string GetString(string strvalue) { return strvalue; }</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 message As String = &#34;Mudassar Khan&#34; Response.Write(&#34;Length of &lt;b&gt; &#34; &amp; message &amp; &#34;&lt;/b&gt; is : &lt;b&gt; &#34; &amp; GetLength(message) &amp; &#34;&lt;/b&gt;&#34;) End Sub Public Function GetLength(ByVal name As String) As Integer Return GetString(name).Length End Function Public Function GetString(ByVal strvalue As String) As String Return strvalue End Function</pre> <p><span style="text-decoration: underline;"><strong>Output</strong></span></p> <p>Length of <strong>Mudassar Khan</strong> is : <strong>13</strong></p> <form id="form1" action="CS.aspx" method="post"> <div class="aspNetHidden"><input id="__VIEWSTATE" name="__VIEWSTATE" type="hidden" value="/wEPDwULLTE2MTY2ODcyMjlkZNM6xhiKLHeFqfg7ZUO4HnRudL7RmecIZPn5vKbxp7Rb" /></div> </form>https://www.aspforums.net:443/Threads/160163/Call-String-method-inside-another-in-C-and-VBNet/https://www.aspforums.net:443/Threads/160163/Call-String-method-inside-another-in-C-and-VBNet/Thu, 21 Feb 2019 03:51:23 GMT