/////////////////////////////////////////////////////////////////////////////////////////
| 674 | /// |
| 675 | /// |
| 676 | std::string swapcase( const std::string & str ) |
| 677 | { |
| 678 | std::string s( str ); |
| 679 | std::string::size_type len = s.size(), i; |
| 680 | |
| 681 | for ( i = 0; i < len; ++i ) |
| 682 | { |
| 683 | if ( ::islower( s[i] ) ) s[i] = ::toupper( s[i] ); |
| 684 | else if (::isupper( s[i] ) ) s[i] = ::tolower( s[i] ); |
| 685 | } |
| 686 | |
| 687 | return s; |
| 688 | } |
| 689 | |
| 690 | ////////////////////////////////////////////////////////////////////////////////////////////// |
| 691 | /// |
no test coverage detected