Export (0) Print
Expand All

TextFieldParser.TrimWhiteSpace Property

Indicates whether leading and trailing white space should be trimmed from field values.

Namespace:  Microsoft.VisualBasic.FileIO
Assembly:  Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)

public bool TrimWhiteSpace { get; set; }

Property Value

Type: System.Boolean
True if leading and trailing white space should be trimmed from field values; otherwise, False.

The default value for this property is True.

This example creates a TextFieldParser, FileReader, and sets the TrimWhiteSpace property to True.

Using FileReader As New Microsoft.VisualBasic.FileIO.
    TextFieldParser("C:\ParserText.txt")

    FileReader.TextFieldType = 
        Microsoft.VisualBasic.FileIO.FieldType.Delimited
    FileReader.SetDelimiters(",")
    FileReader.TrimWhiteSpace = True 
End Using

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft