aboutsummaryrefslogtreecommitdiff
path: root/src/core/utils/StringUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/utils/StringUtils.cpp')
-rw-r--r--src/core/utils/StringUtils.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/core/utils/StringUtils.cpp b/src/core/utils/StringUtils.cpp
index 938ee09232..6d05c9b64e 100644
--- a/src/core/utils/StringUtils.cpp
+++ b/src/core/utils/StringUtils.cpp
@@ -23,13 +23,14 @@
*/
#include "arm_compute/core/utils/StringUtils.h"
-#include <limits>
-#include <sstream>
#include <algorithm>
#include <cmath>
#include <cstdint>
#include <fstream>
+#include <limits>
#include <map>
+#include <numeric>
+#include <sstream>
#include <string>
namespace arm_compute
@@ -61,4 +62,20 @@ std::string float_to_string_with_full_precision(float val)
return ss.str();
}
+
+std::string join(const std::vector<std::string> strings, const std::string &sep)
+{
+ if(strings.empty())
+ {
+ return "";
+ }
+ return std::accumulate(
+ std::next(strings.begin()),
+ strings.end(),
+ strings.at(0),
+ [&sep](const std::string & a, const std::string & b)
+ {
+ return a + sep + b;
+ });
+}
}