| 615 | } |
| 616 | |
| 617 | String String::substring(unsigned int left, unsigned int right) const |
| 618 | { |
| 619 | if (left > right) { |
| 620 | unsigned int temp = right; |
| 621 | right = left; |
| 622 | left = temp; |
| 623 | } |
| 624 | String out; |
| 625 | if (left >= len) return out; |
| 626 | if (right > len) right = len; |
| 627 | char temp = buffer[right]; // save the replaced character |
| 628 | buffer[right] = '\0'; |
| 629 | out = buffer + left; // pointer arithmetic |
| 630 | buffer[right] = temp; //restore character |
| 631 | return out; |
| 632 | } |
| 633 | |
| 634 | /*********************************************/ |
| 635 | /* Modification */ |
nothing calls this directly
no outgoing calls
no test coverage detected