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
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
Published On : 2008-11-06
Copyright © - De Wolf - StudyVB.Com - 2003-2008 - All Rights Reserved. Trademark Notice : Microsoft, Windows, MSDN, Visual Studio, IntelliSense, Visual Basic, Visual Basic .NET, Visual Basic 2008 and Visual C# are either registered trademarks or trademarks of the Microsoft group of companies in the United States and/or other countries.. Disclaimer : StudyVB.Com is an independent website and is not affiliated with, nor has it been authorized, sponsored, or otherwise approved by Microsoft Corporation.
Add to favorites (IE).
No printable version available.