a:10:{s:9:"#provides";s:11:"dojo.string";s:9:"#resource";s:9:"string.js";s:11:"dojo.string";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:25:"String utilities for Dojo";}s:15:"dojo.string.rep";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:3:"str";a:2:{s:4:"type";s:6:"String";s:7:"summary";s:23:"the string to replicate";}s:3:"num";a:2:{s:4:"type";s:7:"Integer";s:7:"summary";s:39:"number of times to replicate the string";}}s:6:"source";s:178:" if(num <= 0 || !str){ return ""; } var buf = []; for(;;){ if(num & 1){ buf.push(str); } if(!(num >>= 1)){ break; } str += str; } return buf.join(""); // String";s:7:"summary";s:41:"Efficiently replicate a string `n` times.";s:7:"returns";s:6:"String";}s:15:"dojo.string.pad";a:6:{s:4:"type";s:8:"Function";s:10:"parameters";a:4:{s:4:"text";a:2:{s:4:"type";s:6:"String";s:7:"summary";s:17:"the string to pad";}s:4:"size";a:2:{s:4:"type";s:7:"Integer";s:7:"summary";s:25:"length to provide padding";}s:2:"ch";a:3:{s:8:"optional";b:1;s:4:"type";s:6:"String";s:7:"summary";s:33:"character to pad, defaults to '0'";}s:3:"end";a:3:{s:8:"optional";b:1;s:4:"type";s:7:"Boolean";s:7:"summary";s:56:"adds padding at the end if true, otherwise pads at start";}}s:6:"source";s:169:" if(!ch){ ch = '0'; } var out = String(text), pad = dojo.string.rep(ch, Math.ceil((size - out.length) / ch.length)); return end ? out + pad : pad + out; // String";s:7:"summary";s:167:"Pad a string to guarantee that it is at least `size` length by filling with the character `ch` at either the start or end of the string. Pads at the start, by default.";s:7:"returns";s:6:"String";s:8:"examples";a:1:{i:0;s:131:" // Fill the string to length 10 with "+" characters on the right. Yields "Dojo++++++". dojo.string.pad("Dojo", 10, "+", true);";}}s:22:"dojo.string.substitute";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:4:{s:8:"template";a:2:{s:4:"type";s:6:"String";s:7:"summary";s:140:"a string with expressions in the form `${key}` to be replaced or `${key:format}` which specifies a format function. keys are case-sensitive.";}s:3:"map";a:2:{s:4:"type";s:12:"Object|Array";s:7:"summary";s:32:"hash to search for substitutions";}s:9:"transform";a:3:{s:8:"optional";b:1;s:4:"type";s:8:"Function";s:7:"summary";s:96:"a function to process all parameters before substitution takes place, e.g. dojo.string.encodeXML";}s:10:"thisObject";a:3:{s:8:"optional";b:1;s:4:"type";s:6:"Object";s:7:"summary";s:75:"where to look for optional format function; default to the global namespace";}}s:6:"source";s:445:" thisObject = thisObject||dojo.global; transform = (!transform) ? function(v){ return v; } : dojo.hitch(thisObject, transform); return template.replace(/\$\{([^\s\:\}]+)(?:\:([^\s\:\}]+))?\}/g, function(match, key, format){ var value = dojo.getObject(key, false, map); if(format){ value = dojo.getObject(format, false, thisObject).call(thisObject, value, key); } return transform(value, key).toString(); }); // string";s:7:"summary";s:100:"Performs parameterized substitutions on a string. Throws an exception if any parameter is unmatched.";s:8:"examples";a:3:{i:0;s:377:" // returns "File 'foo.html' is not found in directory '/temp'." dojo.string.substitute( "File '${0}' is not found in directory '${1}'.", ["foo.html","/temp"] ); // also returns "File 'foo.html' is not found in directory '/temp'." dojo.string.substitute( "File '${name}' is not found in directory '${info.dir}'.", { name: "foo.html", info: { dir: "/temp" } } );";i:1;s:350:"use a transform function to modify the values: // returns "file 'foo.html' is not found in directory '/temp'." dojo.string.substitute( "${0} is not found in ${1}.", ["foo.html","/temp"], function(str){ // try to figure out the type var prefix = (str.charAt(0) == "/") ? "directory": "file"; return prefix + " '" + str + "'"; } );";i:2;s:190:"use a formatter // returns "thinger -- howdy" dojo.string.substitute( "${0:postfix}", ["thinger"], null, { postfix: function(value, key){ return value + " -- howdy"; } } );";}}s:16:"dojo.string.trim";a:7:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:3:"str";a:2:{s:4:"type";s:6:"String";s:7:"summary";s:20:"String to be trimmed";}}s:6:"source";s:21:" return ""; // String";s:7:"summary";s:46:"Trims whitespace from both sides of the string";s:14:"return_summary";s:33:"String Returns the trimmed string";s:11:"description";s:272:"This version of trim() was taken from [Steven Levithan's blog](http://blog.stevenlevithan.com/archives/faster-trim-javascript). The short yet performant version of this function is dojo.trim(), which is part of Dojo base. Uses String.prototype.trim instead, if available.";s:7:"returns";s:6:"String";}s:3:"str";a:1:{s:7:"summary";s:0:"";}s:1:"i";a:1:{s:7:"summary";s:0:"";}s:4:"dojo";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}}