string stripsemicolons(string s)
{
string result;
// prevent reallocations
result.length = s.length;
result.length = 0;

//append to string only when needed
size_t i = 0;
while (i < s.length)
{
size_t j = i;
while (i < s.length && s[i] != ';')
++i;
result ~= s[j..i];
}
}