add format function to string class.