It's equivalent to str = str * "def". I believe that's the case for all +=, *=, etc operators and all types.
On Thursday, February 26, 2015 at 9:23:19 AM UTC-5, Jerry Xiong wrote: > > Considering below code: > str="abc" > str*="def" > Is the new string "def" just be appended after the memory space of "abc", > or both strings were copied to a new momory space? Is str*="def" equal to > str=str*"def" and str="$(str)def" in speed and memory level? Is below code > in O(n) or in O(n^2) speed? > > s="" > for i=1:10000 > s*=string(i) > end >
