| 652 | typename alloc |
| 653 | > |
| 654 | const std::basic_string<charT,traits,alloc> trim ( |
| 655 | const std::basic_string<charT,traits,alloc>& str, |
| 656 | const std::basic_string<charT,traits,alloc>& trim_chars |
| 657 | ) |
| 658 | { |
| 659 | typedef std::basic_string<charT,traits,alloc> string; |
| 660 | typename string::size_type lpos = str.find_first_not_of(trim_chars); |
| 661 | if (lpos != string::npos) |
| 662 | { |
| 663 | typename string::size_type rpos = str.find_last_not_of(trim_chars); |
| 664 | return str.substr(lpos,rpos-lpos+1); |
| 665 | } |
| 666 | else |
| 667 | { |
| 668 | return std::basic_string<charT,traits,alloc>(); |
| 669 | } |
| 670 | } |
| 671 | |
| 672 | template < |
| 673 | typename charT, |
no outgoing calls