diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2017-03-02 08:00:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-02 08:00:28 +0100 |
commit | ee53f85bea20f1d579dae5cce849b4ad9806a9bd (patch) | |
tree | 3f2737222c0aecd313ad3a74a0922a516cbea856 /core/dvector.h | |
parent | f592d1ebfc15a2c9123a502a3cc50267d89b7ef7 (diff) | |
parent | 9f7ce79ea37777997b3c7988dbbdfb2cc4b4597d (diff) |
Merge pull request #7882 from AlexHolly/PoolStringArray-join
added join to PoolStringArray
Diffstat (limited to 'core/dvector.h')
-rw-r--r-- | core/dvector.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/core/dvector.h b/core/dvector.h index 53a29738f7..456be41289 100644 --- a/core/dvector.h +++ b/core/dvector.h @@ -34,6 +34,7 @@ #include "pool_allocator.h" #include "safe_refcount.h" #include "os/rw_lock.h" +#include "ustring.h" struct MemoryPool { @@ -466,6 +467,16 @@ public: return OK; } + String join(String delimiter) { + String rs = ""; + int s = size(); + Read r = read(); + for(int i=0;i<s;i++) { + rs += r[i] + delimiter; + } + rs.erase( rs.length()-delimiter.length(), delimiter.length()); + return rs; + } bool is_locked() const { return alloc && alloc->lock>0; } |