i hoped to see realization of RAII idiom here :) but, yes. it is possible to do with storing into string and length of such string