I'm looking for a good JavaScript equivalent of the C/PHP printf()
or for C#/Java programmers, String.Format()
( IFormatProvider
for .NET). 我正在尋找一個等效於C / PHP printf()
或C#/ Java程序員的String.Format()
(適用於.NET的IFormatProvider
String.Format()
JavaScript。 程序員
My basic requirement is a thousand separator format for numbers for now, but something that handles lots of combinations (including dates) would be good. 個人基本要求是如今使用數字的千位分隔符格式,可是能夠處理不少組合(包括日期)的東西會很好。 框架
I realize Microsoft's Ajax library provides a version of String.Format()
, but we don't want the entire overhead of that framework. 我意識到Microsoft的Ajax庫提供了String.Format()
的版本,可是咱們不但願該框架的所有開銷。 ide