new assign method for string class