/** * Simple example of sstring.h usage. * * @author David Manura, 2006-07 * (c) 2006 David Manura * Distributed under the Boost Software License, Version 1.0. (www.boost.org) */ #include "sstring.h" #include #include using namespace std; using namespace boost; sstring<100> test() { return "asdf"; } int main() { sstring<100> s; s += " TESTasdf "; to_lower(s); trim_left(s); trim_right(s); // transform( s.begin(), s.end(), s.begin(), bind2nd(plus(), 1) ); cout << find_first(s, "asd") << "*" << endl;; replace_first(s, "t", "Z"); cout << s << "*" << endl; if(ends_with(s, "f")) cout << "end f" << endl; s += " "; sstring<100> s2 = trim_copy(s); cout << s2 << "*" << endl; sstring<200> s3 = trim_copy(s); cout << s3 << "*" << endl; cout << test() << endl; return 0; }