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

Unified Diff: client/util/StringUtils.dart

Issue 9382027: Move client/{base, observable, layout, touch, util, view} to samples/ui_lib . (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/util/DateUtils.dart ('k') | client/util/Uri.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/util/StringUtils.dart
===================================================================
--- client/util/StringUtils.dart (revision 4144)
+++ client/util/StringUtils.dart (working copy)
@@ -1,32 +0,0 @@
-// Copyright (c) 2011, 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.
-
-/**
- * General purpose string manipulation utilities.
- */
-class StringUtils {
- /**
- * Returns either [str], or if [str] is null, the value of [defaultStr].
- */
- static String defaultString(String str, [String defaultStr='']) {
- return str === null ? defaultStr : str;
- }
-
- /** Parse string to a double, and handle null intelligently */
- static double parseDouble(String str, [double ifNull = null]) {
- return (str == null) ? ifNull : Math.parseDouble(str);
- }
-
- /** Parse string to a int, and handle null intelligently */
- static int parseInt(String str, [int ifNull = null]) {
- return (str == null) ? ifNull : Math.parseInt(str);
- }
-
- /** Parse bool to a double, and handle null intelligently */
- // TODO(jacobr): corelib should have a boolean parsing method
- static bool parseBool(String str, [bool ifNull = null]) {
- assert(str == null || str == 'true' || str == 'false');
- return (str == null) ? ifNull : (str == 'true');
- }
-}
« no previous file with comments | « client/util/DateUtils.dart ('k') | client/util/Uri.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698