<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
capitalize应用
<br />
原来字符串:<{$a|escape:"htmlall"}><br />
转换为首字大写:<{$a|capitalize}><br />
count_characters 应用:
<br />
不计算空格: <{$a}> <{$a|count_characters}><br />
计算空格:<{$a}> <{$a|count_characters:true}><br />
cat应用:
<br />
原来字符串:<{$a}><br/>
cat连接后:<{$a|cat:"zyf"}>
<br/>
count_paragraphs计算段数应用
<{$a}><br/>
<{$a|count_paragraphs}><br/>
count_sentences应用计算句数<br>
<{$a}>
<{$a|count_sentences}>
<br>
count_words应用计算词数<br>
<{$a}><br>
<{$a|count_words}><br>
利用date_format格式化系统当前时日/时间<br />
系统当前时间:<{$smarty.now|date_format:"%Y-%m-%d-%H:%M:%S"}>
%md应用
<br />
<{$b}>%md格式化:<{$b|string_format:"%10d"}><br />
<{$b}>$m.nf格式化一个实数<{$b|string_format:"%10.2f"}><br />
<{$b}>$m.nf格式化一个实数<{$b|string_format:"%.3f"}><br />
<{$b}>$m.nf格式化一个实数<{$b|string_format:"%.3e"}><br />
<{$b}>
<br />
段落缩进:
<{$b|indent:"4":" "}><br />
<{$a}>
<br />
转化为小写:
<{$a|lower}><b bgt4anh5r />
<{$a}>
<br />
转换为大写:
<{$a|upper}><br />
替换:
<{$a}>
<br />
<{$a|replace:"World":"ooxx"}><br />
<{$a}>
<br />
字符串替换:
<{$a|truncate:"5":"@":true}><br />
<{$a}><br />
<{$a|upper|spacify:"#"}><br />
<{$a|changecolor}><br />
<{$a|changesize}>
</body>
</html>