rename as_string() method to str()

follow stringstream naming