一种反转java String.split()效果的方法? [英] A method to reverse effect of java String.split()?

查看:124
本文介绍了一种反转java String.split()效果的方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种方法将一个字符串数组合成一个分隔的
字符串。与split()相反。我用其他语言看过这个。

I am looking for a method to combine an array of strings into a delimited String. An opposite to split(). I've seen this in other languages.

在我尝试自己编写之前想要问论坛(因为JDK有一切......)

Wanted to ask the forum before I try writing my own( since the JDK has everything...)

谢谢,

推荐答案

我知道JDK中没有这方法的。 Apache Commons Lang 有各种重载 join() StringUtils 做你想做的事。

There's no method in the JDK for this that I'm aware of. Apache Commons Lang has various overloaded join() methods in the StringUtils class that do what you want.

这篇关于一种反转java String.split()效果的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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