Advertisement
rdsedmundo

Javascript printf - by kyl3

Mar 31st, 2013
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. printf = (function (format) {
  2.                 len=format.match(/%/gi);
  3.                 for(i=0;i<=len.length;i++)format=format.replace(/%/, arguments[i+1]);
  4.                 return (format);
  5.             })
  6.            
  7.             printf("Eu sou o % e tenho % anos.", "Kyl3", "9999");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement