Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个字符串str="[0,1,12]"
str="[0,1,12]"
去除 , 和唯一将数字留在后面的最有效"["方法"]"是","什么list?我试过.rstrip()了,但它只接受字符串末尾的字符。
"["
"]"
","
list
.rstrip()
将字符串计算为 a list:
from ast import literal_eval numbers = literal_eval(your_string)
我搜索了几个例子,仍然没有得到。我正在将一个 GOOD 对象列表从控制器传递到 jsp 页面。试图循环列表对象,但它只重复显示一个元素。我应该用豆子吗?如果是,您能否为我的案例提供更具体的示例。
<c:if test="${not empty listGood}"> <c:forEach var="ob"