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

StrDup Function

Class

Microsoft.VisualBasic.Strings

Syntax

StrDup(number,character)
number (required; Integer)

The number of times to duplicate the first character in string

character (required; String, Char, or Object containing a String or Char)

The String or Char whose first character is to be duplicated

Return Value

A String containing the character duplicated the specified number of times

Description

Returns a string that consists of the first character of character duplicated number times

Example

The line:

MsgBox(StrDup(Number:=5, Character:="ABC"))

displays "AAAAA".

VB.NET/VB 6 Differences

The StrDup function is new to VB.NET. It appears in part to be a replacement for the VB 6 String function.

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