OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 /** |
| 6 * Generic utility functions. Stuff that should possibly be in core. |
| 7 */ |
| 8 #library('pub_utils'); |
| 9 |
| 10 // TODO(rnystrom): Move into String? |
| 11 /** Pads [source] to [length] by adding spaces at the end. */ |
| 12 String padRight(String source, int length) { |
| 13 final result = new StringBuffer(); |
| 14 result.add(source); |
| 15 |
| 16 while (result.length < length) { |
| 17 result.add(' '); |
| 18 } |
| 19 |
| 20 return result.toString(); |
| 21 } |
OLD | NEW |