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.Check if string start with capital or small letter in C# and VB.Net<p>Hi <a class="username" rel="rakibxl">rakibxl</a>,</p> <p>Please refer below code for checking upper and lower letter.</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 value = &#34;oRDINE&#34;; string line = &#34;&#34;; int skipLine = 0; bool a = StartLetterCheck(value); if (a == true) { if (line.Replace(&#34;.&#34;, &#34;&#34;).Trim().StartsWith(&#34;ORDINE&#34;)) { skipLine = 3; } } else { if (line.Replace(&#34;.&#34;, &#34;&#34;).Trim().StartsWith(&#34;ordine&#34;)) { skipLine = 1; } } } public bool StartLetterCheck(string word) { return Enumerable.Range(65, 26).Contains((int)word[0]); }</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 value As String = &#34;oRDINE&#34; Dim line As String = &#34;&#34; Dim skipLine As Integer = 0 Dim a As Boolean = StartLetterCheck(value) If a = True Then If line.Replace(&#34;.&#34;, &#34;&#34;).Trim().StartsWith(&#34;ORDINE&#34;) Then skipLine = 3 End If Else If line.Replace(&#34;.&#34;, &#34;&#34;).Trim().StartsWith(&#34;ordine&#34;) Then skipLine = 1 End If End If End Sub Public Function StartLetterCheck(ByVal word As String) As Boolean Return Enumerable.Range(65, 26).Contains(CInt(Val(word(0)))) End Function</pre>https://www.aspforums.net:443/Threads/125840/Check-if-string-start-with-capital-or-small-letter-in-C-and-VBNet/https://www.aspforums.net:443/Threads/125840/Check-if-string-start-with-capital-or-small-letter-in-C-and-VBNet/Mon, 18 Feb 2019 01:53:15 GMT