$nbsp function

String $nbsp([
  1. int length = 1
])

Implementation

String $nbsp([int length = 1]) {
  if (length == 1) {
    return ' ';
  } else if (length < 1) {
    return '';
  }

  var s = StringBuffer('&nbsp;&nbsp;');
  for (var i = 2; i < length; i++) {
    s.write('&nbsp;');
  }

  return s.toString();
}