[英]Removing non- printable data from string
I have a string final line
as 我有一个字符串的
final line
['0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.070802847389,0.0,0.0,', '0.0,0.0,0.169140135429,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,', '0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0261263917462,0.0,0.0,0.0,0.0,0.0,0.0,0.0261263917462,0.0,0.0,0.0,0.0,0.0,0.0,', '0.0961428138228,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,', '']
I have to remove last non printable data ''
from the string. 我必须从字符串中删除最后一个不可打印的数据
''
。
Assuming your list is called final_line
, 假设您的列表名为
final_line
,
final_line.remove('')
should remove ''
from list final_line.remove('')
应从列表中删除''
You can use 您可以使用
list_name.remove('')in this case.
list_name = list_name[:-1]
or 要么
list_name.pop()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.