strip()

本文涉及的产品
实时计算 Flink 版,5000CU*H 3个月
检索分析服务 Elasticsearch 版,2核4GB开发者规格 1个月
大数据开发治理平台 DataWorks,不限时长
简介: strip()

strip():去除字符串两端指定的字符(默认为空格)

string = "   Hello, World!   "
new_string = string.strip()
print(new_string)


相关文章
|
3月前
rstrip()
rstrip()
12 0
|
10月前
|
Python
Python:字符串基操_strip()/rstrip()/lstrip()_lower()/upper()_startswith()/endswith()_split()/rspilt()_join
Python:字符串基操_strip()/rstrip()/lstrip()_lower()/upper()_startswith()/endswith()_split()/rspilt()_join
82 0
|
11月前
|
Python
Python3中strip()、lstrip()、rstrip()用法详解
Python3中strip()、lstrip()、rstrip()用法详解
split
split
56 0
|
Python
Python 字符串切割 str.split()和re.split()
Python 字符串切割 str.split()和re.split()
232 0
|
PHP
str_replace() 和 strpos()
str_replace() 和 strpos()
90 0
str_replace() 和 strpos()
|
Python
strip
1092 0