Moved strip_whitespace_edges() to pbd/whitespace.h
[ardour.git] / libs / pbd3 / whitespace.cc
1 #include <pbd/whitespace.h>
2
3 using namespace std;
4
5 void
6 strip_whitespace_edges (string& str)
7 {   
8     string::size_type i; 
9     string::size_type len;    
10         string::size_type s;
11                                     
12     len = str.length();
13                                         
14     for (i = 0; i < len; ++i) {
15         if (isgraph (str[i])) {
16             break;
17         }
18     }
19
20     s = i;
21
22     for (i = len - 1; i >= 0; --i) {
23         if (isgraph (str[i])) {
24             break;
25         }
26     }
27
28     str = str.substr (s, (i - s) + 1);
29 }
30