TrimWhiteSpace Property


TrimWhiteSpace Property

Location

TextFieldParser.TrimWhiteSpace

Syntax

     Dim fileParser As FileIO.TextFieldParser     ' ...later...     Dim result As Boolean = fileParser.TrimWhiteSpace 

or:

 fileParser.TrimWhiteSpace = whiteSpace 


whiteSpace (required; Boolean)

Indicates whether whitespace around returned fields should be trimmed before those fields are returned (true) or not (False)

Description

The TrimWhiteSpace property gets or sets a value that indicates whether leading and trailing whitespace characters surrounding delimited fields as parsed with the TextFieldParser object should be removed from each field before use (true) or not (False). If you do not specifically set this field, it defaults to true.

Usage at a Glance

  • The TrimWhiteSpace property is only useful with delimited input files, not fixed-width files.

  • You must close the TextFieldParser object when finished with it. Use the object's Close method or create the object instance with the Using keyword. See the TextFieldParser Object entry in this chapter for an example.

Related Framework Entries

  • Microsoft.VisualBasic.FileIO.TextFieldParser.TrimWhiteSpace Property

See Also

Delimiters Property, HasFieldsEnclosedInQuotes Property, ReadFields Method, SetDelimiters Method, TextFieldParser Object, TextFieldType Property




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