Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(896)

Side by Side Diff: sdk/lib/core/string_buffer.dart

Issue 13945009: Make default argument to Iterable.join be "". (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/core/iterable.dart ('k') | sdk/lib/html/dart2js/html_dart2js.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart.core; 5 part of dart.core;
6 6
7 /** 7 /**
8 * The StringBuffer class is useful for concatenating strings 8 * The StringBuffer class is useful for concatenating strings
9 * efficiently. Only on a call to [toString] are the strings 9 * efficiently. Only on a call to [toString] are the strings
10 * concatenated to a single String. 10 * concatenated to a single String.
(...skipping 14 matching lines...) Expand all
25 25
26 /// Adds the contents of [obj], converted to a string, to the buffer. 26 /// Adds the contents of [obj], converted to a string, to the buffer.
27 external void write(Object obj); 27 external void write(Object obj);
28 28
29 /// Adds the string representation of [charCode] to the buffer. 29 /// Adds the string representation of [charCode] to the buffer.
30 external void writeCharCode(int charCode); 30 external void writeCharCode(int charCode);
31 31
32 void writeAll(Iterable objects, [String separator = ""]) { 32 void writeAll(Iterable objects, [String separator = ""]) {
33 Iterator iterator = objects.iterator; 33 Iterator iterator = objects.iterator;
34 if (!iterator.moveNext()) return; 34 if (!iterator.moveNext()) return;
35 if (separator == "") { 35 if (separator.isEmpty) {
36 do { 36 do {
37 write(iterator.current); 37 write(iterator.current);
38 } while (iterator.moveNext()); 38 } while (iterator.moveNext());
39 } else { 39 } else {
40 write(iterator.current); 40 write(iterator.current);
41 while (iterator.moveNext()) { 41 while (iterator.moveNext()) {
42 write(separator); 42 write(separator);
43 write(iterator.current); 43 write(iterator.current);
44 } 44 }
45 } 45 }
46 } 46 }
47 47
48 void writeln([Object obj = ""]) { 48 void writeln([Object obj = ""]) {
49 write(obj); 49 write(obj);
50 write("\n"); 50 write("\n");
51 } 51 }
52 52
53 /** 53 /**
54 * Clears the string buffer. 54 * Clears the string buffer.
55 */ 55 */
56 external void clear(); 56 external void clear();
57 57
58 /// Returns the contents of buffer as a concatenated string. 58 /// Returns the contents of buffer as a concatenated string.
59 external String toString(); 59 external String toString();
60 } 60 }
OLDNEW
« no previous file with comments | « sdk/lib/core/iterable.dart ('k') | sdk/lib/html/dart2js/html_dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698