diff --git a/SimoxUtility/algorithm/string/string_tools.cpp b/SimoxUtility/algorithm/string/string_tools.cpp
index b757e113407b8276babf6d53a64bc15c6ed542e4..379b9c1c2cb779fc674b5cf698041c75646dd0a6 100644
--- a/SimoxUtility/algorithm/string/string_tools.cpp
+++ b/SimoxUtility/algorithm/string/string_tools.cpp
@@ -79,7 +79,10 @@ std::string join(const std::vector<std::string> vec, const std::string& delimite
             if (ignoreEmptyElements && vec.at(index).empty()) continue;
             ss << vec.at(index);
         }
-        if (index != vec.size()) ss << delimiter;
+        if (index < vec.size() - 1)
+        {
+            ss << delimiter;
+        }
     }
     return ss.str();
 }