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

Side by Side Diff: dart/samples/ui_lib/util/StringUtils.dart

Issue 11233061: Revert "Parts must start with 'part of'" and "Attempt to fix VM build" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 2 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 | « dart/samples/ui_lib/util/DateUtils.dart ('k') | dart/samples/ui_lib/util/Uri.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 part of utilslib;
2
3 // 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
4 // 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
5 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
6 4
7 /** 5 /**
8 * General purpose string manipulation utilities. 6 * General purpose string manipulation utilities.
9 */ 7 */
10 class StringUtils { 8 class StringUtils {
11 /** 9 /**
12 * Returns either [str], or if [str] is null, the value of [defaultStr]. 10 * Returns either [str], or if [str] is null, the value of [defaultStr].
(...skipping 12 matching lines...) Expand all
25 return (str == null) ? ifNull : int.parse(str); 23 return (str == null) ? ifNull : int.parse(str);
26 } 24 }
27 25
28 /** Parse bool to a double, and handle null intelligently */ 26 /** Parse bool to a double, and handle null intelligently */
29 // TODO(jacobr): corelib should have a boolean parsing method 27 // TODO(jacobr): corelib should have a boolean parsing method
30 static bool parseBool(String str, [bool ifNull = null]) { 28 static bool parseBool(String str, [bool ifNull = null]) {
31 assert(str == null || str == 'true' || str == 'false'); 29 assert(str == null || str == 'true' || str == 'false');
32 return (str == null) ? ifNull : (str == 'true'); 30 return (str == null) ? ifNull : (str == 'true');
33 } 31 }
34 } 32 }
OLDNEW
« no previous file with comments | « dart/samples/ui_lib/util/DateUtils.dart ('k') | dart/samples/ui_lib/util/Uri.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698