[英]Merge 2 strings by printing the characters from each String one after the other
[英]Java - TextFlow how to add list of strings? One after each other?
假设我有这个例子,如何添加它,以便稍后可以在 textflow window 中用 gui 显示? :
List<String> Test1 = ["a", "b", "c", "d"];
List<String> Test2 = ["1", "2", "3", "4"];
Output 应该是这样的:(“实际 output,每个都在一个新行上”)
Line = "a1";
Line = "b2";
Line = "c3";
这该怎么做? 提前致谢。
你的意思是这样的吗?
String[] Test1 = {"a", "b", "c", "d"};
String[] Test2 = {"1", "2", "3", "4"};
public void main(String[] args)
{
for (int i = 0; i < Test1.length; i++)
{
System.out.println("Line = \"" + Test1[i] + Test2[i] + "\"");
}
}
假设我有这个例子,如何添加它,以便稍后可以在 textflow window 中使用 gui 显示它? :
List<String> Test1 = ["a", "b", "c", "d"];
List<String> Test2 = ["1", "2", "3", "4"];
Output 应该是这样的:(“实际的 output,每个都在一个新行上”)
Line = "a1";
Line = "b2";
Line = "c3";
这个怎么做? 提前致谢。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.