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

查看:24
本文介绍了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() or ".".join().. 所以任何string instance 有方法 join()

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

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

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