在我的程序中,我有以下字符串数组,当我处理程序时,输出有方括号[],但我需要没有方括号[]。有关如何删除它们的建议?删除数组中的特殊字符java
private final static String[] l0 = {"az","Fh md Br", "Inr Gt Cn", "Bl Gs he St st", "Mae is a nw Get", "Pam is a Ml rm", "Comr lab Pl Mt hs", "za"};
public static String sfuffle()
{
List<String> shuffled = new ArrayList<String>(Arrays.asList(phraseString));
Collections.shuffle(shuffled);
System.out.println(shuffled);// added only to have the output
return shuffled + "\n";
}
输出:
[az, Mae is a nw Get, Bl Gs he St st, Fh md Br, za, Comr lab Pl Mt hs, Inr Gt Cn, Pam is a Ml rm]
我所需的输出是:
az, Mae is a nw Get, Bl Gs he St st, Fh md Br, za, Comr lab Pl Mt hs, Inr Gt Cn, Pam is a Ml rm
你这是什么意思outout?你在控制台上看到了什么?返回值?或两者? –
@PhilippSander显然是返回值 - System.out仅用于调试。 – MightyPork
@MightyPork,为什么oyu确定他不想要两个? –