1. `upper()` 方法:将字符串中的所有字母转换为大写。
```python
text = "hello, world!"
print(text.upper()) 输出:HELLO, WORLD!
2. `lower()` 方法:将字符串中的所有字母转换为小写。
```python
text = "HELLO, WORLD!"
print(text.lower()) 输出:hello, world!
3. `capitalize()` 方法:将字符串的首字母转换为大写,其余字母转换为小写。
```python
text = "hello, world!"
print(text.capitalize()) 输出:Hello, world!
4. `title()` 方法:将字符串中每个单词的首字母转换为大写,其余字母转换为小写。
```python
text = "hello, world!"
print(text.title()) 输出:Hello, World!
5. `swapcase()` 方法:将字符串中的所有大写字母转换为小写,所有小写字母转换为大写。
```python
text = "Hello, World!"
print(text.swapcase()) 输出:hELLO, wORLD!
6. `casefold()` 方法:将字符串中的所有字母转换为小写,忽略大小写差异。
```python
text = "Hello, World!"
print(text.casefold()) 输出:hello, world!