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

LSet Function

Class

Microsoft.VisualBasic.Strings

Syntax

LSet(Source, Length)
Source (required; String)

The string to be left aligned

Length (required; Integer)

The length of the returned string

Return Value

String

Description

Left aligns a string

Rules at a Glance

  • If the length of Source is greater than or equal to Length, the function returns only the leftmost Length characters.

  • If the length of Source is less than Length, spaces are added to the right of the returned string so that its length becomes Length.

VB.NET/VB 6 Differences

  • In VB 6, LSet was implemented as a kind of assignment statement. Because it is implemented as a function in VB.NET, its syntax is completely different.

  • In VB 6, LSet could be used only with fixed-length strings. In VB.NET, LSet works with all CTS String data.

See Also

RSet 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