Chr, ChrW Functions


Chr, ChrW Functions

Class

Microsoft.VisualBasic.Strings

Syntax

     Dim result As Char = Chr(charCode)     Dim result As Char = ChrW(charCode) 


charCode (required; Integer)

An expression that evaluates to a character code

Description

The Chr and ChrW functions return the character represented by charCode.

Usage at a Glance

  • The Chr version uses the active code page of the current thread; the ChrW function always uses the general Unicode character set.

  • The following table lists some of the more commonly used character codes that are supplied in the call to the Chr function:

    Code

    Constant

    Description

    0

    vbNullChar

    Used as a string terminator in many languages, such as with C and C++

    8

    vbBack

    The backspace character

    9

    vbTab

    The tab character

    10

    vbLf

    The linefeed character

    13

    vbCr

    The carriage return character

    34

    ControlChars.Quote

    The quotation mark


Version Differences

  • The VB 6 ChrB function is no longer supported.

  • The VB 6 version of the Chr function returns a String; the .NET version returns a Char.

See Also

Asc, AscW Functions




Visual Basic 2005(c) In a Nutshell
Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))
ISBN: 059610152X
EAN: 2147483647
Year: 2004
Pages: 712

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net