codeLeadingWhitespace function

String codeLeadingWhitespace(
  1. String text
)

Implementation

String codeLeadingWhitespace(String text) {
  var end = 0;
  while (end < text.length &&
      (text.codeUnitAt(end) == 32 || text.codeUnitAt(end) == 9)) {
    end++;
  }
  return text.substring(0, end);
}