source: CIVL/examples/experimental/reverse_CIVL/ADFirstAidKit/profile/string-utils.h

main
Last change on this file was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 595 bytes
Line 
1#ifndef STRING_UTILS_H
2#define STRING_UTILS_H 1
3#include <string>
4#include <vector>
5#include <iostream>
6#include <sstream>
7#include <iomanip>
8
9std::string prefix(const std::string &, int);
10std::string suffix(const std::string &, int);
11std::vector<std::string> split(const std::string &, char);
12// Specialization of split(str, sep).back()
13std::string last_part_after(const std::string &, char);
14
15template <typename T> std::string toString(const T &ref)
16{
17 using namespace std;
18 ostringstream string_buffer;
19 string_buffer << ref;
20 return string_buffer.str();
21}
22#endif
Note: See TracBrowser for help on using the repository browser.