ARTICLE

How to use char functions in VB.NET

Posted by Rohatash Kumar Articles | Visual Basic 2010 February 02, 2011
In this article we will learn how to use char functions in VB.NET.
Download Files:
 
Reader Level:

In this article we will learn how to use char functions in VB.NET.

Char Functions

These are the following Char functions.

Char.ToUpper() Function

The ToUpper function is used to convert lowercase character to uppercase.

Syntax

char.ToUpper ("s")

This function returns a copy of the character in uppercase.

Char.IsDigit()

The IsDigit method Indicates whether the specified Unicode character is categorized as a decimal digit.

Syntax

Char.IsDigit (Char1)

This function returns true if str1 is a decimal digit, otherwise, false.

Char.Equals() Function

The Equals method is used to check whether this instance is equal to a specified object.

For example

The below example defines the char Functions.

Module Module1

    Sub Main()

        Dim str As Char

        str = Char.ToUpper("a")

        Console.WriteLine("This defines the Toupper function: " & str)

        Dim Char1 As Char

        Char1 = "8"

        If Char.IsDigit(Char1) Then

            Console.WriteLine("The character is a digit.")

        Else

            Console.WriteLine("The character is a letter or symbol.")

        End If

        Dim chA As Char

        chA = "A"c

        Dim chB As Char

        chB = "B"c

        Console.WriteLine(chA.Equals("A"c))

        Console.WriteLine("b"c.Equals(chB))

    End Sub

End Module

OUTPUT

ch1.gif 

Figure 1.

Login to add your contents and source code to this article
share this article :
post comment
 
Nevron Diagram
Become a Sponsor
PREMIUM SPONSORS
  • ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications. Visit DynamicPDF here
    Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
Nevron Diagram
Become a Sponsor