數據類型—字符串

字符串:git

                 字符串是一個有序字符的集合,用於存儲和表示基本的文本信息orm

字符串的切片:ip

     a = 'red blue"字符串

     a.count("e")it

>>>2form

    a.count("e",2,7)集合

>>>0di

 

 

stripco

 

a = "                alex                    "join

a.strip()

 

replace 

a = " my score is 580 "

a.replace("580","630")

 

查:find      index      count

刪:字符串不可變,不能刪除

改:replace    upper    lower   casefold     swapcase   strip    split 

格式化: format    rjust   ljust   join 

判斷:  isdigital   startwith   endwith 

相關文章
相關標籤/搜索