Iterator based string formatting