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

Unified Diff: recipes/test/core/strings/using_raw_strings_test.dart

Issue 12335109: Strings recipes for the Dart Cookbook (Closed) Base URL: https://github.com/dart-lang/cookbook.git@master
Patch Set: Made most changes requested my Kathy. Created 7 years, 9 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 | « recipes/test/core/strings/substituting_strings_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipes/test/core/strings/using_raw_strings_test.dart
diff --git a/recipes/test/core/strings/using_raw_strings_test.dart b/recipes/test/core/strings/using_raw_strings_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..1c4f4b2fafe33223752cd83c473472a7e933355a
--- /dev/null
+++ b/recipes/test/core/strings/using_raw_strings_test.dart
@@ -0,0 +1,24 @@
+library using_raw_strings_test;
+
+import 'package:unittest/unittest.dart';
+
+void main() {
+ var x = "asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf";
+ var y = "\u0061sdf";
+ var z = "asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf";
+ print(x == z);
+ print(identical(x, z));
+ print("$x, $z");
+ return;
+
+ var string = '+1,';
+ var r = r'(\+|-)?\d+';
+ var r2 = '(\+|-)?\d+';
+ print("r = $r");
+ print("r2 = $r2");
+ print('When properly escaped: ' r'(\\+|-)?\\d+');
+ var regExp = new RegExp(r);
+
+ print(regExp.firstMatch(string).group(0));
+ print(3.0 == 3.0000);
+}
« no previous file with comments | « recipes/test/core/strings/substituting_strings_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698