嗨,我正试着分开一段文字
For example
'C:/bye1.txt'
i would want 'C:/bye1.txt' only
'C:/bye1.txt C:/hello1.txt'
i would want C:/hello1.txt only
'C:/bye1.txt C:/hello1.txt C:/bye2 C:/bye3'
i would want C:/bye3 and so on.
我试过的代码,问题是它只打印出Y
x = "Hello i am boey"
Last = x[len(x)-1]
print Last
看看这个:
基本上,使用^{} 分割字符串,然后得到最后一项(这就是
[-1]
所做的)。你知道吗虽然更像Python:
尝试:
相关问题 更多 >
编程相关推荐