首页 > 其他 > 详细

public String concat(String str):将当前字符串和参数字符串拼接成为返回值新的。

时间:2020-03-14 21:23:25      阅读:84      评论:0      收藏:0      [点我收藏+]
 1 public class String01 {
 2     public static void main(String[] args){
 3         //拼接字符串
 4 
 5         String str1 = "Hello";
 6         String str2 = "World";
 7         String str3 = str1.concat(str2);
 8         System.out.println(str1);//Hello 原封不动
 9         System.out.println(str2);//World 原封不动
10         System.out.println(str3);//HelloWorld 新的字符串
11     }
12 }
13     

 

public String concat(String str):将当前字符串和参数字符串拼接成为返回值新的。

原文:https://www.cnblogs.com/bingquan1/p/12493853.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!