Python 3 string.join()等效吗? [英] Python 3 string.join() equivalent?

查看:66
本文介绍了Python 3 string.join()等效吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在python 2中使用string.join()方法,但似乎在python 3中已将其删除.python 3中的等效方法是什么?

I've been using string.join() method in python 2 but it seems like it has been removed in python 3. What is the equivalent method in python 3?

string.join()方法使我可以将多个字符串与其他字符串之间的字符串组合在一起.例如,string.join((("a","b","c"),.")将得到"a.b.c".

string.join() method let me combine multiple strings together with a string in between every other string. For example, string.join(("a", "b", "c"), ".") would result "a.b.c".

推荐答案

'.'.join()".".join() ..因此,任何字符串 instance 都具有方法join()

'.'.join() or ".".join().. So any string instance has the method join()

这篇关于Python 3 string.join()等效吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆