(String str, String prefix, String prefixNew)
| 564 | } |
| 565 | |
| 566 | public static String replacePrefix(String str, String prefix, String prefixNew) |
| 567 | { |
| 568 | if (str != null && prefix != null) |
| 569 | { |
| 570 | if (!str.startsWith(prefix)) |
| 571 | { |
| 572 | return str; |
| 573 | } |
| 574 | else |
| 575 | { |
| 576 | if (prefixNew == null) |
| 577 | { |
| 578 | prefixNew = ""; |
| 579 | } |
| 580 | |
| 581 | str = str.substring(prefix.length()); |
| 582 | return prefixNew + str; |
| 583 | } |
| 584 | } |
| 585 | else |
| 586 | { |
| 587 | return str; |
| 588 | } |
| 589 | } |
| 590 | |
| 591 | public static int findPrefix(String[] strs, String prefix) |
| 592 | { |
no test coverage detected