Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
String.format 是这个:http: //msdn.microsoft.com/en-us/library/bb397701 (v=vs.100).aspx
请注意,这是 String 类上的静态方法,而不是原型上的方法。
您不能在接口上声明静态方法,因此您可能需要实际覆盖lib.d.tsString 的定义:
lib.d.ts
declare var String: { new (value?: any): String; (value?: any): string; prototype: String; fromCharCode(...codes: number[]): string; format(format: string, ...args: any[]) : string; }