Python字符串操作大全
文章目录
Python中字符串的定义:由Unicode码点组成的不可变序列(Strings are immutable sequences of Unicode code points)。
Python内置函数提供了强大的字符串的使用方法,熟练掌握常见的方法,对于数据处理、面试、笔试都非常有用。
dir(str)
首先,字符串是一种序列,所以支持切片和索引操作,具体可以看这篇文章Python基础之数据类型详解。
下面是常见的内建函数用法总结:

s="hello testers !"
s="hello testers !"
s=" hellotesters! "

s1="hellotesters!"

s1="hello testers!"
s1="hellotesters!1234567890"



评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论