java在字符串第n次出现后追加字符串
我有一个字符串s
,我想在指定位置附加另一个字符串s1
String s = "17.4755,2.0585,23.6489,12.0045";
String s1=",,,,"
现在我想在","
字符的第n次出现之后添加字符串s1
我刚刚开始学习Java
你可以在下面搜索框中键入要查询的问题!
我有一个字符串s
,我想在指定位置附加另一个字符串s1
String s = "17.4755,2.0585,23.6489,12.0045";
String s1=",,,,"
现在我想在","
字符的第n次出现之后添加字符串s1
我刚刚开始学习Java
# 1 楼答案
我想这就是你想要的
# 2 楼答案
直接使用
String
是不值得费心的一个简单的方法是将
String
转换为List
并对其进行操作印刷品:
# 3 楼答案
您可以使用以下方法: