| 450 | } |
| 451 | |
| 452 | BString BString::replace(char oldChar, char newChar) { |
| 453 | makeWritable(0); |
| 454 | for (int i = 0; i < data->len; i++) { |
| 455 | if (data->str[i] == oldChar) { |
| 456 | data->str[i] = newChar; |
| 457 | } |
| 458 | } |
| 459 | return *this; |
| 460 | } |
| 461 | |
| 462 | BString BString::replace(const char* oldString, const char* newString) { |
| 463 | if (isEmpty()) { |
no test coverage detected