q.erase(0,3) gets the value of q, not the reference to it, so doing anything with this value will not affect the value stored in the array itself.
This should work:
temp_string = q
q = temp_string
(Replaces the array element with the changed string)
Or even simpler:
q = q.substr(4)
(Does everything in one step, but needs a method with a return value)