Python去除字符串中的非數字、非字母

只保留數字,中間有小數點請使用正則表達式 "".join(filter(str.isdigit, "Colour Temperature is 2700 Kelvin")) 2700 只保留字母 "".join(filter(str.isalpha, "Colour Temperature is 2700 Kelvin")) ColourTemperatureisKelvin 只保留數字和字母 "
相關文章
相關標籤/搜索