【发布时间】:2013-12-22 14:52:21
【问题描述】:
目前,我有两个字符串
String str1="In the morning
I have breakfast
After";
String str2="In the afternoon
I have dinner
Before";
我想合并两个字符串来创建一个字符串如下:
String strMerge="In the morning
In the afternoon
I have breakfast
I have dinner
After
Before"
我该怎么办?
【问题讨论】:
-
strMerge= str1+str2??请明确您需要合并的依据。 -
你的合并有什么规则吗?
-
您的示例是无效的 Java。字符串文字必须在它们开始的行结束之前终止。