Chromium Code Reviews| Index: pkg/args/lib/src/utils.dart |
| diff --git a/pkg/args/lib/src/utils.dart b/pkg/args/lib/src/utils.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..9e71f50a82b6b8541e464b45b63092365da4181e |
| --- /dev/null |
| +++ b/pkg/args/lib/src/utils.dart |
| @@ -0,0 +1,17 @@ |
| +// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +library args.utils; |
| + |
| +/// Pads [source] to [length] by adding spaces at the end. |
| +String padRight(String source, int length) { |
| + final result = new StringBuffer(); |
| + result.write(source); |
| + |
| + while (result.length < length) { |
| + result.write(' '); |
| + } |
|
Bob Nystrom
2014/12/11 20:25:31
result.write(' ' * (length - result.length));
nweiz
2014/12/11 23:55:24
Done.
|
| + |
| + return result.toString(); |
| +} |