added format functions for dynamic string together with unit test