user defined string copy function