(String str, String suffix, String suffixNew)
| 539 | } |
| 540 | |
| 541 | public static String replaceSuffix(String str, String suffix, String suffixNew) |
| 542 | { |
| 543 | if (str != null && suffix != null) |
| 544 | { |
| 545 | if (!str.endsWith(suffix)) |
| 546 | { |
| 547 | return str; |
| 548 | } |
| 549 | else |
| 550 | { |
| 551 | if (suffixNew == null) |
| 552 | { |
| 553 | suffixNew = ""; |
| 554 | } |
| 555 | |
| 556 | str = str.substring(0, str.length() - suffix.length()); |
| 557 | return str + suffixNew; |
| 558 | } |
| 559 | } |
| 560 | else |
| 561 | { |
| 562 | return str; |
| 563 | } |
| 564 | } |
| 565 | |
| 566 | public static String replacePrefix(String str, String prefix, String prefixNew) |
| 567 | { |
no test coverage detected