simple example of slow string function because of temporaries