TextUtility.NormalizeIndentation Method
- Namespace
- Kampute.DocToolkit.Support
- Assembly
- Kampute.DocToolkit.dll
Definition
Normalizes the indentation of the specified text lines in-place.
public static void NormalizeIndentation(IList<string> lines, int tabSize = 4)Parameters
linesIList<string>- The list of text lines to normalize.
tabSizeint optional- The number of spaces to replace each tab with. Default is 4.
Exceptions
- ArgumentNullException
- Thrown when the
linesarray isnull.
Remarks
This method modifies the input array in-place, performing these steps:
- Replaces all tabs with spaces.
- Removes trailing whitespace from each line.
- Determines the minimum indentation across all non-empty lines.
- Removes the minimum indentation from the beginning of each line.
