1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.util; |
22 |
|
|
23 |
|
import java.io.UnsupportedEncodingException; |
24 |
|
import java.net.URLEncoder; |
25 |
|
import java.util.ArrayList; |
26 |
|
import java.util.List; |
27 |
|
import java.util.Locale; |
28 |
|
import java.util.regex.Matcher; |
29 |
|
import java.util.regex.Pattern; |
30 |
|
|
|
|
| 0% |
Uncovered Elements: 325 (325) |
Complexity: 96 |
Complexity Density: 0.5 |
|
31 |
|
public class StringUtils |
32 |
|
{ |
33 |
|
private static final Pattern DELIMITERS_PATTERN = Pattern |
34 |
|
.compile(".*='[^']*(?!')"); |
35 |
|
|
36 |
|
private static final char PERCENT = '%'; |
37 |
|
|
38 |
|
private static final boolean DEBUG = false; |
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
private static String[] urlEncodings = new String[255]; |
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
|
49 |
|
|
50 |
|
@param |
51 |
|
|
52 |
|
@param |
53 |
|
|
54 |
|
@param |
55 |
|
|
56 |
|
@param |
57 |
|
|
58 |
|
|
|
|
| 0% |
Uncovered Elements: 18 (18) |
Complexity: 4 |
Complexity Density: 0.33 |
|
59 |
0 |
public static final char[] insertCharAt(char[] in, int position,... |
60 |
|
int count, char ch) |
61 |
|
{ |
62 |
0 |
char[] tmp = new char[in.length + count]; |
63 |
|
|
64 |
0 |
if (position >= in.length) |
65 |
|
{ |
66 |
0 |
System.arraycopy(in, 0, tmp, 0, in.length); |
67 |
0 |
position = in.length; |
68 |
|
} |
69 |
|
else |
70 |
|
{ |
71 |
0 |
System.arraycopy(in, 0, tmp, 0, position); |
72 |
|
} |
73 |
|
|
74 |
0 |
int index = position; |
75 |
0 |
while (count > 0) |
76 |
|
{ |
77 |
0 |
tmp[index++] = ch; |
78 |
0 |
count--; |
79 |
|
} |
80 |
|
|
81 |
0 |
if (position < in.length) |
82 |
|
{ |
83 |
0 |
System.arraycopy(in, position, tmp, index, in.length - position); |
84 |
|
} |
85 |
|
|
86 |
0 |
return tmp; |
87 |
|
} |
88 |
|
|
89 |
|
|
90 |
|
|
91 |
|
|
92 |
|
@param |
93 |
|
@param |
94 |
|
@param |
95 |
|
@return |
96 |
|
|
|
|
| 0% |
Uncovered Elements: 15 (15) |
Complexity: 4 |
Complexity Density: 0.36 |
|
97 |
0 |
public static final char[] deleteChars(char[] in, int from, int to)... |
98 |
|
{ |
99 |
0 |
if (from >= in.length || from < 0) |
100 |
|
{ |
101 |
0 |
return in; |
102 |
|
} |
103 |
|
|
104 |
0 |
char[] tmp; |
105 |
|
|
106 |
0 |
if (to >= in.length) |
107 |
|
{ |
108 |
0 |
tmp = new char[from]; |
109 |
0 |
System.arraycopy(in, 0, tmp, 0, from); |
110 |
0 |
to = in.length; |
111 |
|
} |
112 |
|
else |
113 |
|
{ |
114 |
0 |
tmp = new char[in.length - to + from]; |
115 |
0 |
System.arraycopy(in, 0, tmp, 0, from); |
116 |
0 |
System.arraycopy(in, to, tmp, from, in.length - to); |
117 |
|
} |
118 |
0 |
return tmp; |
119 |
|
} |
120 |
|
|
121 |
|
|
122 |
|
|
123 |
|
|
124 |
|
|
125 |
|
@param |
126 |
|
@param |
127 |
|
|
128 |
|
@return |
129 |
|
|
|
|
| 0% |
Uncovered Elements: 10 (10) |
Complexity: 3 |
Complexity Density: 0.5 |
|
130 |
0 |
public static String getLastToken(String input, String token)... |
131 |
|
{ |
132 |
0 |
if (input == null) |
133 |
|
{ |
134 |
0 |
return null; |
135 |
|
} |
136 |
0 |
if (token == null) |
137 |
|
{ |
138 |
0 |
return input; |
139 |
|
} |
140 |
0 |
String[] st = input.split(token); |
141 |
0 |
return st[st.length - 1]; |
142 |
|
} |
143 |
|
|
144 |
|
|
145 |
|
|
146 |
|
|
147 |
|
|
148 |
|
|
149 |
|
@param |
150 |
|
@param |
151 |
|
@return |
152 |
|
|
|
|
| 0% |
Uncovered Elements: 54 (54) |
Complexity: 17 |
Complexity Density: 0.53 |
|
153 |
0 |
public static String[] separatorListToArray(String input,... |
154 |
|
String delimiter) |
155 |
|
{ |
156 |
0 |
int seplen = delimiter.length(); |
157 |
0 |
if (input == null || input.equals("") || input.equals(delimiter)) |
158 |
|
{ |
159 |
0 |
return null; |
160 |
|
} |
161 |
0 |
List<String> jv = new ArrayList<>(); |
162 |
0 |
int cp = 0, pos, escape; |
163 |
0 |
boolean wasescaped = false, wasquoted = false; |
164 |
0 |
String lstitem = null; |
165 |
0 |
while ((pos = input.indexOf(delimiter, cp)) >= cp) |
166 |
|
{ |
167 |
0 |
escape = (pos > 0 && input.charAt(pos - 1) == '\\') ? -1 : 0; |
168 |
0 |
if (wasescaped || wasquoted) |
169 |
|
{ |
170 |
|
|
171 |
0 |
jv.set(jv.size() - 1, lstitem = lstitem + delimiter |
172 |
|
+ input.substring(cp, pos + escape)); |
173 |
|
} |
174 |
|
else |
175 |
|
{ |
176 |
0 |
jv.add(lstitem = input.substring(cp, pos + escape)); |
177 |
|
} |
178 |
0 |
cp = pos + seplen; |
179 |
0 |
wasescaped = escape == -1; |
180 |
|
|
181 |
0 |
wasquoted = DELIMITERS_PATTERN.matcher(lstitem).matches(); |
182 |
|
} |
183 |
0 |
if (cp < input.length()) |
184 |
|
{ |
185 |
0 |
String c = input.substring(cp); |
186 |
0 |
if (wasescaped || wasquoted) |
187 |
|
{ |
188 |
|
|
189 |
0 |
jv.set(jv.size() - 1, lstitem + delimiter + c); |
190 |
|
} |
191 |
|
else |
192 |
|
{ |
193 |
0 |
if (!c.equals(delimiter)) |
194 |
|
{ |
195 |
0 |
jv.add(c); |
196 |
|
} |
197 |
|
} |
198 |
|
} |
199 |
0 |
if (jv.size() > 0) |
200 |
|
{ |
201 |
0 |
String[] v = jv.toArray(new String[jv.size()]); |
202 |
0 |
jv.clear(); |
203 |
0 |
if (DEBUG) |
204 |
|
{ |
205 |
0 |
ErrorLog.errPrintln("Array from '" + delimiter |
206 |
|
+ "' separated List:\n" + v.length); |
207 |
0 |
for (int i = 0; i < v.length; i++) |
208 |
|
{ |
209 |
0 |
ErrorLog.errPrintln("item " + i + " '" + v[i] + "'"); |
210 |
|
} |
211 |
|
} |
212 |
0 |
return v; |
213 |
|
} |
214 |
0 |
if (DEBUG) |
215 |
|
{ |
216 |
0 |
ErrorLog.errPrintln( |
217 |
|
"Empty Array from '" + delimiter + "' separated List"); |
218 |
|
} |
219 |
0 |
return null; |
220 |
|
} |
221 |
|
|
222 |
|
|
223 |
|
|
224 |
|
|
225 |
|
|
226 |
|
|
227 |
|
@param |
228 |
|
@param |
229 |
|
@return |
230 |
|
|
|
|
| 0% |
Uncovered Elements: 26 (26) |
Complexity: 8 |
Complexity Density: 0.57 |
|
231 |
0 |
public static String arrayToSeparatorList(String[] list, String separator)... |
232 |
|
{ |
233 |
0 |
StringBuffer v = new StringBuffer(); |
234 |
0 |
if (list != null && list.length > 0) |
235 |
|
{ |
236 |
0 |
for (int i = 0, iSize = list.length; i < iSize; i++) |
237 |
|
{ |
238 |
0 |
if (list[i] != null) |
239 |
|
{ |
240 |
0 |
if (v.length() > 0) |
241 |
|
{ |
242 |
0 |
v.append(separator); |
243 |
|
} |
244 |
|
|
245 |
0 |
v.append(list[i]); |
246 |
|
} |
247 |
|
} |
248 |
0 |
if (DEBUG) |
249 |
|
{ |
250 |
0 |
System.err |
251 |
|
.println("Returning '" + separator + "' separated List:\n"); |
252 |
0 |
ErrorLog.errPrintln(v.toString()); |
253 |
|
} |
254 |
0 |
return v.toString(); |
255 |
|
} |
256 |
0 |
if (DEBUG) |
257 |
|
{ |
258 |
0 |
ErrorLog.errPrintln( |
259 |
|
"Returning empty '" + separator + "' separated List\n"); |
260 |
|
} |
261 |
0 |
return "" + separator; |
262 |
|
} |
263 |
|
|
264 |
|
|
265 |
|
|
266 |
|
|
267 |
|
|
268 |
|
|
269 |
|
@param |
270 |
|
@param |
271 |
|
@return |
272 |
|
|
|
|
| 0% |
Uncovered Elements: 13 (13) |
Complexity: 4 |
Complexity Density: 0.44 |
|
273 |
0 |
public static String listToDelimitedString(List<String> terms,... |
274 |
|
String delim) |
275 |
|
{ |
276 |
0 |
StringBuilder sb = new StringBuilder(32); |
277 |
0 |
if (terms != null && !terms.isEmpty()) |
278 |
|
{ |
279 |
0 |
boolean appended = false; |
280 |
0 |
for (String term : terms) |
281 |
|
{ |
282 |
0 |
if (appended) |
283 |
|
{ |
284 |
0 |
sb.append(delim); |
285 |
|
} |
286 |
0 |
appended = true; |
287 |
0 |
sb.append(term); |
288 |
|
} |
289 |
|
} |
290 |
0 |
return sb.toString(); |
291 |
|
} |
292 |
|
|
293 |
|
|
294 |
|
|
295 |
|
|
296 |
|
|
297 |
|
@param |
298 |
|
@return |
299 |
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 4 |
Complexity Density: 0.8 |
|
300 |
0 |
public static int parseInt(String s)... |
301 |
|
{ |
302 |
0 |
int result = 0; |
303 |
0 |
if (s != null && s.length() > 0) |
304 |
|
{ |
305 |
0 |
try |
306 |
|
{ |
307 |
0 |
result = Integer.parseInt(s); |
308 |
|
} catch (NumberFormatException ex) |
309 |
|
{ |
310 |
|
} |
311 |
|
} |
312 |
0 |
return result; |
313 |
|
} |
314 |
|
|
315 |
|
|
316 |
|
|
317 |
|
|
318 |
|
|
319 |
|
@param |
320 |
|
@param |
321 |
|
@return |
322 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
323 |
0 |
public static int compareVersions(String v1, String v2)... |
324 |
|
{ |
325 |
0 |
return compareVersions(v1, v2, null); |
326 |
|
} |
327 |
|
|
328 |
|
|
329 |
|
|
330 |
|
|
331 |
|
|
332 |
|
@param |
333 |
|
@param |
334 |
|
@param |
335 |
|
|
336 |
|
|
337 |
|
@return |
338 |
|
|
|
|
| 0% |
Uncovered Elements: 36 (36) |
Complexity: 9 |
Complexity Density: 0.38 |
|
339 |
0 |
public static int compareVersions(String v1, String v2,... |
340 |
|
String pointSeparator) |
341 |
|
{ |
342 |
0 |
if (v1 == null || v2 == null) |
343 |
|
{ |
344 |
0 |
return 0; |
345 |
|
} |
346 |
0 |
String[] toks1 = v1.split("\\."); |
347 |
0 |
String[] toks2 = v2.split("\\."); |
348 |
0 |
int i = 0; |
349 |
0 |
for (; i < toks1.length; i++) |
350 |
|
{ |
351 |
0 |
if (i >= toks2.length) |
352 |
|
{ |
353 |
|
|
354 |
|
|
355 |
|
|
356 |
0 |
return 1; |
357 |
|
} |
358 |
0 |
String tok1 = toks1[i]; |
359 |
0 |
String tok2 = toks2[i]; |
360 |
0 |
if (pointSeparator != null) |
361 |
|
{ |
362 |
|
|
363 |
|
|
364 |
|
|
365 |
0 |
tok1 = tok1.replace(pointSeparator, "."); |
366 |
0 |
tok2 = tok2.replace(pointSeparator, "."); |
367 |
|
} |
368 |
0 |
try |
369 |
|
{ |
370 |
0 |
float f1 = Float.valueOf(tok1); |
371 |
0 |
float f2 = Float.valueOf(tok2); |
372 |
0 |
int comp = Float.compare(f1, f2); |
373 |
0 |
if (comp != 0) |
374 |
|
{ |
375 |
0 |
return comp; |
376 |
|
} |
377 |
|
} catch (NumberFormatException e) |
378 |
|
{ |
379 |
0 |
System.err |
380 |
|
.println("Invalid version format found: " + e.getMessage()); |
381 |
0 |
return 0; |
382 |
|
} |
383 |
|
} |
384 |
|
|
385 |
0 |
if (i < toks2.length) |
386 |
|
{ |
387 |
|
|
388 |
|
|
389 |
|
|
390 |
0 |
return -1; |
391 |
|
} |
392 |
|
|
393 |
|
|
394 |
|
|
395 |
|
|
396 |
0 |
return 0; |
397 |
|
} |
398 |
|
|
399 |
|
|
400 |
|
|
401 |
|
|
402 |
|
|
403 |
|
@param |
404 |
|
@return |
405 |
|
|
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 3 |
Complexity Density: 0.6 |
|
406 |
0 |
public static String toSentenceCase(String s)... |
407 |
|
{ |
408 |
0 |
if (s == null) |
409 |
|
{ |
410 |
0 |
return s; |
411 |
|
} |
412 |
0 |
if (s.length() <= 1) |
413 |
|
{ |
414 |
0 |
return s.toUpperCase(Locale.ROOT); |
415 |
|
} |
416 |
0 |
return s.substring(0, 1).toUpperCase(Locale.ROOT) |
417 |
|
+ s.substring(1).toLowerCase(Locale.ROOT); |
418 |
|
} |
419 |
|
|
420 |
|
|
421 |
|
|
422 |
|
|
423 |
|
|
424 |
|
@param |
425 |
|
@return |
426 |
|
|
|
|
| 0% |
Uncovered Elements: 28 (28) |
Complexity: 8 |
Complexity Density: 0.44 |
|
427 |
0 |
public static String stripHtmlTags(String text)... |
428 |
|
{ |
429 |
0 |
if (text == null) |
430 |
|
{ |
431 |
0 |
return null; |
432 |
|
} |
433 |
0 |
String tmp2up = text.toUpperCase(Locale.ROOT); |
434 |
0 |
int startTag = tmp2up.indexOf("<HTML>"); |
435 |
0 |
if (startTag > -1) |
436 |
|
{ |
437 |
0 |
text = text.substring(startTag + 6); |
438 |
0 |
tmp2up = tmp2up.substring(startTag + 6); |
439 |
|
} |
440 |
|
|
441 |
0 |
int endTag = tmp2up.indexOf("</BODY>"); |
442 |
0 |
if (endTag > -1) |
443 |
|
{ |
444 |
0 |
text = text.substring(0, endTag); |
445 |
0 |
tmp2up = tmp2up.substring(0, endTag); |
446 |
|
} |
447 |
0 |
endTag = tmp2up.indexOf("</HTML>"); |
448 |
0 |
if (endTag > -1) |
449 |
|
{ |
450 |
0 |
text = text.substring(0, endTag); |
451 |
|
} |
452 |
|
|
453 |
0 |
if (startTag == -1 && (text.contains("<") || text.contains(">"))) |
454 |
|
{ |
455 |
0 |
text = text.replaceAll("<", "<"); |
456 |
0 |
text = text.replaceAll(">", ">"); |
457 |
|
} |
458 |
0 |
return text; |
459 |
|
} |
460 |
|
|
461 |
|
|
462 |
|
|
463 |
|
|
464 |
|
|
465 |
|
@param |
466 |
|
@param |
467 |
|
@return |
468 |
|
|
|
|
| 0% |
Uncovered Elements: 14 (14) |
Complexity: 5 |
Complexity Density: 0.62 |
|
469 |
0 |
public static String urlEncode(String s, String encodable)... |
470 |
|
{ |
471 |
0 |
if (s == null || s.isEmpty()) |
472 |
|
{ |
473 |
0 |
return s; |
474 |
|
} |
475 |
|
|
476 |
|
|
477 |
|
|
478 |
|
|
479 |
0 |
if (encodable.indexOf(PERCENT) != -1) |
480 |
|
{ |
481 |
0 |
s = urlEncode(s, PERCENT); |
482 |
|
} |
483 |
|
|
484 |
0 |
for (char c : encodable.toCharArray()) |
485 |
|
{ |
486 |
0 |
if (c != PERCENT) |
487 |
|
{ |
488 |
0 |
s = urlEncode(s, c); |
489 |
|
} |
490 |
|
} |
491 |
0 |
return s; |
492 |
|
} |
493 |
|
|
494 |
|
|
495 |
|
|
496 |
|
|
497 |
|
|
498 |
|
@param |
499 |
|
@param |
500 |
|
@return |
501 |
|
|
|
|
| 0% |
Uncovered Elements: 10 (10) |
Complexity: 3 |
Complexity Density: 0.5 |
|
502 |
0 |
static String urlEncode(String s, char c)... |
503 |
|
{ |
504 |
0 |
String decoded = String.valueOf(c); |
505 |
0 |
if (s.indexOf(decoded) != -1) |
506 |
|
{ |
507 |
0 |
String encoded = getUrlEncoding(c); |
508 |
0 |
if (!encoded.equals(decoded)) |
509 |
|
{ |
510 |
0 |
s = s.replace(decoded, encoded); |
511 |
|
} |
512 |
|
} |
513 |
0 |
return s; |
514 |
|
} |
515 |
|
|
516 |
|
|
517 |
|
|
518 |
|
|
519 |
|
|
520 |
|
|
521 |
|
|
522 |
|
|
523 |
|
@param |
524 |
|
@param |
525 |
|
@return |
526 |
|
|
|
|
| 0% |
Uncovered Elements: 12 (12) |
Complexity: 4 |
Complexity Density: 0.5 |
|
527 |
0 |
public static String urlDecode(String s, String encodable)... |
528 |
|
{ |
529 |
0 |
if (s == null || s.isEmpty()) |
530 |
|
{ |
531 |
0 |
return s; |
532 |
|
} |
533 |
|
|
534 |
0 |
for (char c : encodable.toCharArray()) |
535 |
|
{ |
536 |
0 |
String encoded = getUrlEncoding(c); |
537 |
0 |
if (s.indexOf(encoded) != -1) |
538 |
|
{ |
539 |
0 |
String decoded = String.valueOf(c); |
540 |
0 |
s = s.replace(encoded, decoded); |
541 |
|
} |
542 |
|
} |
543 |
0 |
return s; |
544 |
|
} |
545 |
|
|
546 |
|
|
547 |
|
|
548 |
|
|
549 |
|
|
550 |
|
@param |
551 |
|
@return |
552 |
|
|
|
|
| 0% |
Uncovered Elements: 12 (12) |
Complexity: 5 |
Complexity Density: 0.62 |
|
553 |
0 |
private static String getUrlEncoding(char c)... |
554 |
|
{ |
555 |
0 |
if (c < 0 || c >= urlEncodings.length) |
556 |
|
{ |
557 |
0 |
return String.valueOf(c); |
558 |
|
} |
559 |
|
|
560 |
0 |
String enc = urlEncodings[c]; |
561 |
0 |
if (enc == null) |
562 |
|
{ |
563 |
0 |
try |
564 |
|
{ |
565 |
0 |
enc = urlEncodings[c] = URLEncoder.encode(String.valueOf(c), |
566 |
|
"UTF-8"); |
567 |
|
} catch (UnsupportedEncodingException e) |
568 |
|
{ |
569 |
0 |
enc = urlEncodings[c] = String.valueOf(c); |
570 |
|
} |
571 |
|
} |
572 |
0 |
return enc; |
573 |
|
} |
574 |
|
|
|
|
| 0% |
Uncovered Elements: 10 (10) |
Complexity: 4 |
Complexity Density: 0.67 |
|
575 |
0 |
public static int firstCharPosIgnoreCase(String text, String chars)... |
576 |
|
{ |
577 |
0 |
int min = text.length() + 1; |
578 |
0 |
for (char c : chars.toLowerCase(Locale.ROOT).toCharArray()) |
579 |
|
{ |
580 |
0 |
int i = text.toLowerCase(Locale.ROOT).indexOf(c); |
581 |
0 |
if (0 <= i && i < min) |
582 |
|
{ |
583 |
0 |
min = i; |
584 |
|
} |
585 |
|
} |
586 |
0 |
return min < text.length() + 1 ? min : -1; |
587 |
|
} |
588 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 3 |
Complexity Density: 1 |
|
589 |
0 |
public static boolean equalsIgnoreCase(String s1, String s2)... |
590 |
|
{ |
591 |
0 |
if (s1 == null || s2 == null) |
592 |
|
{ |
593 |
0 |
return s1 == s2; |
594 |
|
} |
595 |
0 |
return s1.toLowerCase(Locale.ROOT).equals(s2.toLowerCase(Locale.ROOT)); |
596 |
|
} |
597 |
|
|
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 2 |
Complexity Density: 0.33 |
|
598 |
0 |
public static int indexOfFirstWhitespace(String text)... |
599 |
|
{ |
600 |
0 |
int index = -1; |
601 |
0 |
Pattern pat = Pattern.compile("\\s"); |
602 |
0 |
Matcher m = pat.matcher(text); |
603 |
0 |
if (m.find()) |
604 |
|
{ |
605 |
0 |
index = m.start(); |
606 |
|
} |
607 |
0 |
return index; |
608 |
|
} |
609 |
|
|
610 |
|
|
611 |
|
|
612 |
|
|
613 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
614 |
0 |
public static String replaceLast(String string, String toReplace,... |
615 |
|
String replacement) |
616 |
|
{ |
617 |
0 |
int pos = string.lastIndexOf(toReplace); |
618 |
0 |
if (pos > -1) |
619 |
|
{ |
620 |
0 |
return new StringBuilder().append(string.substring(0, pos)) |
621 |
|
.append(replacement) |
622 |
|
.append(string.substring(pos + toReplace.length())) |
623 |
|
.toString(); |
624 |
|
} |
625 |
|
else |
626 |
|
{ |
627 |
0 |
return string; |
628 |
|
} |
629 |
|
|
630 |
|
} |
631 |
|
|
632 |
|
|
633 |
|
|
634 |
|
|
|
|
| 0% |
Uncovered Elements: 11 (11) |
Complexity: 3 |
Complexity Density: 0.43 |
|
635 |
0 |
public static int maxLength(List<String> l)... |
636 |
|
{ |
637 |
0 |
int max = 0; |
638 |
0 |
for (String s : l) |
639 |
|
{ |
640 |
0 |
if (s == null) |
641 |
0 |
continue; |
642 |
0 |
if (s.length() > max) |
643 |
0 |
max = s.length(); |
644 |
|
} |
645 |
0 |
return max; |
646 |
|
} |
647 |
|
} |