Added another implementation using Stringbuilder.