Python 3 string.join() 等效吗?

编程入门 行业动态 更新时间:2024-10-27 21:11:09
本文介绍了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() 等效吗?

本文发布于:2023-11-04 12:35:39,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1557958.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Python   string   join

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!