Table of Contents [内容列表] Preface [序] I. Getting Started [开始] 1. What is Smarty? [什么是Smaty?] 2. Installation [安装] Requirements [安装] Basic Installation [基本安装] Extended Setup [扩展设置] II. Smarty For Template Designers [模板设计者篇] 3. Basic Syntax [基本语法] Comm
Smarty - the compiling PHP template engine Monte Ohrt Andrei Zmievski Copyright ? 2001, 2002, 2003 by ispi of Lincoln, Inc. -------------------------------------------------------------------------------- Table of Contents [内容列表] Preface [序] I. Ge
Table of Contents [内容列表] Preface [序] I. Getting Started [开始] 1. What is Smarty? [什么是Smaty?] 2. Installation [安装] Requirements [安装] Basic Installation [基本安装] Extended Setup [扩展设置] II. Smarty For Template Designers [模板设计者篇] 3. Basic Syntax [基本语法] Comm
Table of Contents [内容列表] Preface [序] I. Getting Started [开始] 1. What is Smarty? [什么是Smaty?] 2. Installation [安装] Requirements [安装] Basic Installation [基本安装] Extended Setup [扩展设置] II. Smarty For Template Designers [模板设计者篇] 3. Basic Syntax [基本语法] Comm
Table of Contents [内容列表] Preface [序] I. Getting Started [开始] 1. What is Smarty? [什么是Smaty?] 2. Installation [安装] Requirements [安装] Basic Installation [基本安装] Extended Setup [扩展设置] II. Smarty For Template Designers [模板设计者篇] 3. Basic Syntax [基本语法] Comm
Table of Contents [内容列表] Preface [序] I. Getting Started [开始] 1. What is Smarty? [什么是Smaty?] 2. Installation [安装] Requirements [安装] Basic Installation [基本安装] Extended Setup [扩展设置] II. Smarty For Template Designers [模板设计者篇] 3. Basic Syntax [基本语法] Comm
在读文件时常常得到一些\n和引号之类的符号,可以使用字符串的成员函数strip()来去除。
1.去除首尾不需要的字符
a= 'This is test string' # strip()会默认去除'\n','\r','\t',' ',制表回车换行和空格等字符
a.strip('')
>>> 'This is test string'
b = ' This is another string ' #首尾两个空格
b.strip(' ')
>>>'Thi