逗号拼接字符串
可以使用String类的静态方法join()来实现这个功能,示例代码如下: ```java public class PhoneNumbers { public static void main(String[] args) { String phoneNumber1 = "18801083588"; String phoneNumber2 = "15709106355"; String phoneNumber3 = "18001931933"; String phoneNumberString = String.join(",", phoneNumber1, phoneNumber2, phoneNumber3); System.out.println(phoneNumberString); } } ``` 输出结果为: ```text 18801083576,15709106355,18001931933 ```
标签:java,String,逗号,拼接,字符串,public From: https://www.cnblogs.com/yangzailu/p/17309610.html