Visual Basic 2008 9.0 .NET Examples and Ebook
  Home

Introduction to Visual Basic

Arrays

Volgend Onderwerp

Char and String Datatypes

Vorig Onderwerp

Numeric Literals and Type Coercion

|

Temporal Datatype Date

Volgend Onderwerp
-


The Char datatype represents exactly one character. Its default value is " "c ( space ).

The String datatype can represent a text ( zero or more characters ). Its default value is Nothing.


Module Example1
    Sub Main()
        Dim someCharacter As Char
        Console.WriteLine("*" & someCharacter & "*")                       ' (1)
        '
        someCharacter = "a"c                                               ' (2)
        Console.WriteLine("*" & someCharacter & "*")
        '
        Console.ReadLine()
    End Sub
End Module
Download Broncode

Output :

 * *
 *a*

Line (2) illustrates how a Char literal is formed, surrounding double quotes and a trailing c ( indicating Char and not String ) is used.


Updated On : 2008-10-25

Download Broncode

Published On : 2008-11-06

Char and String Datatypes

Vorig Onderwerp

Numeric Literals and Type Coercion

|

Temporal Datatype Date

Volgend Onderwerp

Introduction to Visual Basic

Arrays

Volgend Onderwerp
  Home  
Nederlands
Nederlands

Add to favorites (IE).


No printable version available.