Archived Comments (locked)
|
|
The following is an archive of comments made before threaded discussions was implemented (November 16th, 2008) |
|
|
C'mon people, stop my monolog. |
|
|
usage
>>> x = new String(" Hello %s ");
[" ", "H", "e", "l", "l", "o", " ", "%", "s", " "]
>>> x.sprintf(" ? ")
" Hello ? "
>>> x.sprintf(" ? ", "a")
" Hello %s "
>>> x.sprintf(4)
" Hello 4 "
>>> x = new String(" %s %s ! ")
[" ", "%", "s", " ", "%", "s", " ", "!", " "]
>>> x.sprintf("Hello", "World")
" Hello World ! "
>>> x.sprintf("Hello", "John")
" Hello John ! "
>>> x.sprintf("Hello", "Good Nite")
" Hello Good Nite ! "
>>> x.sprintf("Hello", "Good Bye")
" Hello Good Bye ! "
>>> x.sprintf("Hello", ", Good Bye")
" Hello , Good Bye ! "
>>> x.sprintf("Hello", "& Good Bye")
" Hello & Good Bye ! "
|
|
|
problem fixed, it works! I added it to the String-object's prototype
>>> x = new String(" Hello %s ");
[" ", "H", "e", "l", "l", "o", " ", "%", "s", " "]
>>> x.sprintf(" ? ")
" Hello ? "
|
|
|
Does somebody have an idea for this issue? I have been trying different kinds of things but nothing works! I made this function so it can be adapted to other programs but there is no way to execute it. perhaps it gets executed previously somewhere in the cache or something like that? if you look at the source you may see what I've
at the moment I am doing an extension to the Object & String prototypes. any other ocurrences? I also tried to copy the function to the window or document property but whenever I try to reach it through the firebug console, its unreachable or something! probably gets set as a private method? |
|
|
thx pojo, I added it as a firefox extension and tried to run it through the firebug console but it didn't work perhaps it gets executed but it never reaches the actual document for execution. so I am making a test script that will execute the sprintf function lets see how it works. cheers! |
|
|
good idea :) |
|
|
okay!
|