Subj : Re: define new function in Class String (Spidermonkey) To : Blaubaer From : Brendan Eich Date : Wed Jan 05 2005 11:03 am Blaubaer wrote: > Sorry, for bugging you. But I want to understand this engine, but it is hard > to understand for a small programmer. > I learning by doing with some faults. I know. > > But I use the sprintf function in some C++ String classes like: > > AnsiString a; > a.sprintf("I'am to small with %d!", 1); > ShowMessage(a); You can do something like this in JS, for sure, but again, you shouldn't hack up jsstr.c to do it. Make your own AnsiString (or whatever) object class, give it the right constructor and methods via JS_InitClass, including a toString() method that converts its internal string back into a primitive string. /be .