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

Unified Diff: pkg/analysis_server/lib/src/services/correction/strings.dart

Issue 569723004: Issue 19801. Fix for inlining referenced function with an expression body. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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 | « no previous file | pkg/analysis_server/lib/src/services/refactoring/inline_method.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/services/correction/strings.dart
diff --git a/pkg/analysis_server/lib/src/services/correction/strings.dart b/pkg/analysis_server/lib/src/services/correction/strings.dart
index 05644382c5311b49924165f6af2eabcc5a4d3742..53da60bb35992a1ed1920bee5a24ae8bad4d49e4 100644
--- a/pkg/analysis_server/lib/src/services/correction/strings.dart
+++ b/pkg/analysis_server/lib/src/services/correction/strings.dart
@@ -107,6 +107,16 @@ String remove(String str, String remove) {
return str.replaceAll(remove, '');
}
+String removeEnd(String str, String remove) {
+ if (isEmpty(str) || isEmpty(remove)) {
+ return str;
+ }
+ if (str.endsWith(remove)) {
+ return str.substring(0, str.length - remove.length);
+ }
+ return str;
+}
+
String removeStart(String str, String remove) {
if (isEmpty(str) || isEmpty(remove)) {
return str;
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/refactoring/inline_method.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698