(v)sprintf

码农软件 · 软件分类 · 其他jQuery插件 · 2020-01-16 06:13:56

软件介绍

Implements both a somewhat stripped down "classic" version of the C sprintf (no support for width, sign, padding and flags), and a python-like one employing named parameters.

Why another implementation, when we already have one? well:

  • size: 2262 bytes;
  • features: I wanted named arguments, like in python;
  • license: the existing implementation uses a BSD license, I wanted GPL;
  • and fun, of course.

Usage

//sprintf
//positional arguments
var classic = $.sprintf('%s %d%% %.3f', 'string', 40, 3.141593);
// classic = 'string 40% 3.142'

//named arguments
var named = $.sprintf('%(name)s: %(value)d', {name: 'age', value: 40});
// named = 'age: 40'

//vsprintf
var classic = $.vsprintf('%s %d%% %.3f', ['string', 40, 3.141593]);
// classic = 'string 40% 3.142'

//named arguments
var named = $.vsprintf('%(name)s: %(value)d', [{name: 'age', value: 40}]);
// named = 'age: 40'

本文地址:https://www.codercto.com/soft/d/23477.html

博客秘诀:超人气博客是怎样炼成的

博客秘诀:超人气博客是怎样炼成的

Darren Rowse、Chris Garrett / 向怡宁 / 人民邮电出版社 / 201005 / 39.00元

作为Web 2.0的新生事物的博客,如今已蓬勃发展,呈燎原之势,业已成为许多人的一种生活方式。中国从事博客写作的人数已达千万级,各类博客网站不可胜数。 然而,为什么有的博客人气鼎盛,拥趸众多,有的博客却门前冷落,少人问津呢?究竟应该怎样写好自己的博客,才能让它吸引更多访客的关注呢?博客网站还能为我做什么呢? 本书的两位作者长期主持知名博客站点ProBlogger.net,指导了成千上万......一起来看看 《博客秘诀:超人气博客是怎样炼成的》 这本书的介绍吧!

随机密码生成器
随机密码生成器

多种字符组合密码

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具