Click or drag to resize

SyntaxExtensionsNormalizeWhitespace Method (SyntaxToken, String, Boolean)



Creates a new syntax token with all whitespace and end of line trivia replaced with regularly formatted trivia.

Namespace:  Microsoft.CodeAnalysis.CSharp
Assembly:  Microsoft.CodeAnalysis.CSharp (in Microsoft.CodeAnalysis.CSharp.dll) Version: 2.3.0-dev-56735-00. Commit Hash: <developer build>
Syntax
public static SyntaxToken NormalizeWhitespace(
	this SyntaxToken token,
	string indentation,
	bool elasticTrivia
)

Parameters

token
Type: Microsoft.CodeAnalysisSyntaxToken
The token to normalize.
indentation
Type: SystemString
A sequence of whitespace characters that defines a single level of indentation.
elasticTrivia
Type: SystemBoolean
If true the replaced trivia is elastic trivia.

Return Value

Type: SyntaxToken

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type SyntaxToken. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also