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

LTrim Function

Class

Microsoft.VisualBasic.Strings

Syntax

LTrim(str)
str (required; String)

A valid string expression

Return Value

String

Description

Removes any leading spaces from str

Rules at a Glance

  • If str has no leading spaces, the function returns str unmodified.

  • If str is Nothing, LTrim returns Nothing.

Programming Tips and Gotchas

It is unwise to create data relationships that rely on leading spaces, especially since most string-based data types in relational database-management systems (like SQL Server and Access) automatically remove leading spaces.

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