//| Copyright: (C) 2020-2024 Kevin Larke //| License: GNU GPL version 3.0 or above. See the accompanying LICENSE file. #include "cwCommon.h" #include "cwLog.h" #include "cwCommonImpl.h" #include "cwMem.h" #include "cwString.h" unsigned cw::str::len( const char* s) { if( s == nullptr ) return 0; return strlen(s); } char* cw::str::dupl( const char* s ) { return mem::duplStr(s); } char* cw::str::join( const char* sep, const char** subStrArray, unsigned ssN ) { unsigned sN = 0; char* s = nullptr; for(unsigned i=0; i= 1 ) sN += (ssN-1) * len(sep); if( sN == 0 ) return nullptr; sN += 1; s = mem::alloc(sN); s[0] = 0; for(unsigned i=0; i=1 && i