Python 字串處理
print ('Hello Python')
print ('Hello','Python',123)
print (123)
print ("Hello")
print ("I'm Python")
print ('I say "Hey"')
s = 'Hello' + 'Python' # str + str
s
s = 'Hello' * 3 + 'Python'
s
#===================
len(s) #字串長度
s[0]
s[:10]
s[5:]
s[5:10] #from 5~9 (不包含10)
s[:]
s[::2] #間隔2
#===================
#字串切割(Split)
s = 'hello, world, I, am, Python'
words = s.split(',') #回傳到串列
words
#===================
#字串合併(Join)
",".join(words) #用 , 來串接
#大小寫轉換
"HELLO".lower()
'hello'.upper()
a ="hello"
a
a.upper()




