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

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

Issue 562333002: Issue 17024. Quick Fix to find imported library. (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
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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 } 118 }
119 119
120 120
121 String repeat(String s, int n) { 121 String repeat(String s, int n) {
122 StringBuffer sb = new StringBuffer(); 122 StringBuffer sb = new StringBuffer();
123 for (int i = 0; i < n; i++) { 123 for (int i = 0; i < n; i++) {
124 sb.write(s); 124 sb.write(s);
125 } 125 }
126 return sb.toString(); 126 return sb.toString();
127 } 127 }
128
129
130 /**
131 * Gets the substring after the last occurrence of a separator.
132 * The separator is not returned.
133 */
134 String substringAfterLast(String str, String separator) {
135 if (isEmpty(str)) {
136 return str;
137 }
138 if (isEmpty(separator)) {
139 return '';
140 }
141 int pos = str.lastIndexOf(separator);
142 if (pos == -1) {
143 return str;
144 }
145 return str.substring(pos + separator.length);
146 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698