Leave space in sprintf : sprintf « Dojo toolkit « JavaScript DHTML






Leave space in sprintf

 

<html>
  <head>
    <script type="text/javascript">
      var djConfig = {
        baseScriptUri : "js/dojo/",
        parseOnLoad : true
      };
    </script>
    <script type="text/javascript" src="js/dojo/dojo/dojo.js"></script>
    <script>
      dojo.require("dojox.string.Builder");
      dojo.require("dojox.string.sprintf");

      function testIt() {
        var s = dojox.string.sprintf("[%10s]", "goat");
        alert(s)

      }
    </script>
  </head>
  <body onLoad="testIt();">
  </body>
</html>

   
  








Dojo-toolkit.zip( 3,849 k)

Related examples in the same category

1.Integer sprintf
2.Output as char
3.dojo string sprintf:%.3e