Returns the leading indentation (spaces and tabs) from the beginning of the given string.
Iterates through the input string and collects all consecutive whitespace or tab characters
from the start, stopping at the first non-whitespace, non-tab character.
Parameters
str: string
The input string from which to extract the indentation.
Returns string
A string containing the leading whitespace and tab characters, or an empty string if none are found.
Returns the leading indentation (spaces and tabs) from the beginning of the given string.
Iterates through the input string and collects all consecutive whitespace or tab characters from the start, stopping at the first non-whitespace, non-tab character.