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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/refactoring/inline_method.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 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library services.src.correction.strings; 5 library services.src.correction.strings;
6 6
7 7
8 /** 8 /**
9 * "$" 9 * "$"
10 */ 10 */
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 return isSpace(c) || c == 0x0D || c == 0x0A; 100 return isSpace(c) || c == 0x0D || c == 0x0A;
101 } 101 }
102 102
103 String remove(String str, String remove) { 103 String remove(String str, String remove) {
104 if (isEmpty(str) || isEmpty(remove)) { 104 if (isEmpty(str) || isEmpty(remove)) {
105 return str; 105 return str;
106 } 106 }
107 return str.replaceAll(remove, ''); 107 return str.replaceAll(remove, '');
108 } 108 }
109 109
110 String removeEnd(String str, String remove) {
111 if (isEmpty(str) || isEmpty(remove)) {
112 return str;
113 }
114 if (str.endsWith(remove)) {
115 return str.substring(0, str.length - remove.length);
116 }
117 return str;
118 }
119
110 String removeStart(String str, String remove) { 120 String removeStart(String str, String remove) {
111 if (isEmpty(str) || isEmpty(remove)) { 121 if (isEmpty(str) || isEmpty(remove)) {
112 return str; 122 return str;
113 } 123 }
114 if (str.startsWith(remove)) { 124 if (str.startsWith(remove)) {
115 return str.substring(remove.length); 125 return str.substring(remove.length);
116 } 126 }
117 return str; 127 return str;
118 } 128 }
119 129
(...skipping 17 matching lines...) Expand all
137 } 147 }
138 if (isEmpty(separator)) { 148 if (isEmpty(separator)) {
139 return ''; 149 return '';
140 } 150 }
141 int pos = str.lastIndexOf(separator); 151 int pos = str.lastIndexOf(separator);
142 if (pos == -1) { 152 if (pos == -1) {
143 return str; 153 return str;
144 } 154 }
145 return str.substring(pos + separator.length); 155 return str.substring(pos + separator.length);
146 } 156 }
OLDNEW
« 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