OLD | NEW |
---|---|
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 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 | 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 /** | 5 /** |
6 * Tests for the toString methods on collections and maps. | 6 * Tests for the toString methods on collections and maps. |
7 */ | 7 */ |
8 | 8 |
9 library collection_to_string; | 9 library collection_to_string; |
10 | 10 |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
292 return rand.nextInt(max); | 292 return rand.nextInt(max); |
293 } | 293 } |
294 | 294 |
295 /** Returns a random boolean value. */ | 295 /** Returns a random boolean value. */ |
296 bool randomBool() { | 296 bool randomBool() { |
297 return rand.nextBool(); | 297 return rand.nextBool(); |
298 } | 298 } |
299 | 299 |
300 /** Returns the alphabetized characters in a string. */ | 300 /** Returns the alphabetized characters in a string. */ |
301 String alphagram(String s) { | 301 String alphagram(String s) { |
302 List<int> chars = s.charCodes; | 302 List<int> chars = s.codeUnits.toList(); |
floitsch
2013/02/19 14:03:06
Add comment to explain why "toList" (make it modif
Lasse Reichstein Nielsen
2013/02/20 06:38:23
Done.
Lasse Reichstein Nielsen
2013/02/20 06:38:23
Done.
| |
303 chars.sort((int a, int b) => a - b); | 303 chars.sort((int a, int b) => a - b); |
304 return new String.fromCharCodes(chars); | 304 return new String.fromCharCodes(chars); |
305 } | 305 } |
OLD | NEW |