collapse var declarations in string() method