Python內置函數提供了強大的字符串的使用方法,熟練掌握常見的方法,對於數據處理、面試、筆試都很是有用。面試
dir(str)
首先,字符串是一種序列,因此支持切片和索引操做,具體能夠看這篇文章Python基礎之數據類型詳解。函數
s="hello testers !"
s=" hellotesters! "
s1="hellotesters!"
s1="hello testers!"
s1="hellotesters!1234567890"