Python内置函数提供了强大的字符串的使用方法,熟练掌握常见的方法,对于数据处理、面试、笔试都很是有用。面试
dir(str)
首先,字符串是一种序列,因此支持切片和索引操做,具体能够看这篇文章Python基础之数据类型详解。函数
s="hello testers !"
s=" hellotesters! "
s1="hellotesters!"
s1="hello testers!"
s1="hellotesters!1234567890"