Return a new string of the old string wrapped with the start and end values - Node.js String

Node.js examples for String:sub string

Description

Return a new string of the old string wrapped with the start and end values

Demo Code


/**/*from  ww w .jav a2  s  .c o  m*/
 * Return a new string of the old string wrapped with the start and end values
 * @version 1.0.0
 * @date June 30, 2010
 * @package jquery-sparkle {@link http://www.balupton/projects/jquery-sparkle}
 * @author Benjamin "balupton" Lupton {@link http://www.balupton.com}
 * @copyright (c) 2009-2010 Benjamin Arthur Lupton {@link http://www.balupton.com}
 * @license GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 */
String.prototype.wrap = String.prototype.wrap || function(start,end){
  // Wrap the string
  return start+this+end;
};

Related Tutorials