diff options
Diffstat (limited to 'c,cc')
-rw-r--r-- | c,cc/rmtag.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/c,cc/rmtag.cc b/c,cc/rmtag.cc new file mode 100644 index 0000000..bdcc8e6 --- /dev/null +++ b/c,cc/rmtag.cc @@ -0,0 +1,22 @@ +/* + * rmtag.cpp + * + * Patrick Simianer <p@simianer.de> + * 2015-06 + */ + +#include <iostream> +#include <string> + +using namespace std; + +int main(int argc, char const* argv[]) +{ + string s = "<a> b </a>"; + cout << s << endl; + cout << s.find_first_of(">") << endl; + cout << s.find_last_of("<") << endl; + cout << s.substr(s.find_first_of(">")+1, s.find_last_of("<")-3) << endl; + return 0; +} + |