iT邦幫忙

2019 iT 邦幫忙鐵人賽

DAY 7
0
自我挑戰組

Python 自學歷程分享系列 第 7

字串-1

在Python中若要宣告字串,可以使用單引號或雙引號,這樣的設計就可以讓你產生有 ' 或 " 內容的字串。
https://ithelp.ithome.com.tw/upload/images/20181010/20112140PTe4XFFTlo.png
接下來就來介紹一些常見的字串操作方式:
1.宣告字串
https://ithelp.ithome.com.tw/upload/images/20181010/20112140HohVBFTzSs.png
2.串連字串+
https://ithelp.ithome.com.tw/upload/images/20181010/20112140CGwlxYFxUe.png
3.複製字串*
https://ithelp.ithome.com.tw/upload/images/20181010/20112140PFasRaVcsw.png
4.選取字串[開始:結束:間隔]
https://ithelp.ithome.com.tw/upload/images/20181010/20112140CyoqizAk1H.png
5.len、split、replace、join 字串操作就在下篇再為大家介紹摟


上一篇
可變和不可變物件
下一篇
字串-2
系列文
Python 自學歷程分享30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言