Index: /trunk/include/iprt/cpp/ministring.h
===================================================================
--- /trunk/include/iprt/cpp/ministring.h	(revision 68153)
+++ /trunk/include/iprt/cpp/ministring.h	(revision 68154)
@@ -532,4 +532,13 @@
 
     /**
+     * Erases a sequence from the string.
+     *
+     * @returns Reference to the object.
+     * @param   offStart        Where in @a this string to start erasing.
+     * @param   cchLength       How much following @a offStart to erase.
+     */
+    RTCString &erase(size_t offStart = 0, size_t cchLength = npos);
+
+    /**
      * Replaces a span of @a this string with a replacement string.
      *
Index: /trunk/src/VBox/Runtime/common/string/ministring.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/string/ministring.cpp	(revision 68153)
+++ /trunk/src/VBox/Runtime/common/string/ministring.cpp	(revision 68154)
@@ -278,4 +278,26 @@
 }
 
+RTCString &RTCString::erase(size_t offStart /*= 0*/, size_t cchLength /*= npos*/)
+{
+    size_t cch = length();
+    if (offStart < cch)
+    {
+        if (cchLength >= cch - offStart)
+        {
+            /* Trail removal, nothing to move.  */
+            m_cch = offStart;
+            m_psz[offStart] = '\0';
+        }
+        else if (cchLength > 0)
+        {
+            /* Pull up the tail to offStart. */
+            size_t cchAfter = cch - offStart - cchLength;
+            memmove(&m_psz[offStart], &m_psz[offStart + cchLength], cchAfter);
+            m_cch = cch -= cchLength;
+            m_psz[cch] = '\0';
+        }
+    }
+    return *this;
+}
 
 RTCString &RTCString::replace(size_t offStart, size_t cchLength, const RTCString &rStrReplacement)
