python之字符串处理
2011-06-24 13:30
351 查看
str = 'A' # define a string print('say:' + str*5) str = " B " print('say:' + str.strip()) str = "string" print(str[2]) print(str[1:3]) # 这里的3不是步长,误会良久,呵呵 print(str[1:-2]) print(str[1:]) print(str[:2]) ---------- python ---------- say:AAAAA say:B r tr tri tring st Output completed (0 sec consumed) - Normal Termination
相关文章推荐
- 字符串处理神器——Python Regular Expression
- Python:字符串处理
- 在Python中处理字符串之ljust()方法的使用简介
- Python中拼接字符串和数字时报错如何处理
- Python的字符串处理
- Python大量字符串组合相加处理优化
- python下mysql数据库处理输入字符串
- Python对字符串进行处理
- python字符串处理函数
- python字符串处理常用方法
- Python实现简单文本字符串处理的方法
- 王亟亟的Python学习之路(九)-sorted()排序以及简单字符串处理
- python基础—字符串处理、文件处理(运维必备)
- Python中字符串的处理技巧分享
- Python字符串处理函数记录
- [Python] 字符串处理 (函数/方法)
- Python Cookbook 第二版 汉化版 [Recipe 1.1] 逐个处理字符串中的各个字符
- Python处理json字符串转化为字典
- python数据清洗系列之字符串处理详解
- Python处理\u形式字符串