O'Reilly logo

VB.NET Language in a Nutshell, Second Edition by Steven Roman PhD, Paul Lomax, Ron Petrusha

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

GetChar Function

Class

Microsoft.VisualBasic.Strings

Syntax

GetChar(str, index)
str (required; String)

The string from which to extract a character

index (required; Integer)

Position of character (1-based)

Return Value

A Char containing the character at position index

Description

Returns the character that is at position index within a given string

Rules at a Glance

  • The first character in str is at index 1.

  • If index exceeds the number of character positions in str, an error is generated.

VB.NET/VB 6 Differences

The GetChar function is new to VB.NET.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required