我有类似的东西:
if (File.Exists("important.txt"))
{
using (StreamWriter writer = File.AppendText("important.txt"))
writer.Write("\r\n" + name + "," + socialid + "," + town + "," + numsold);
}
else
{
using (StreamWriter writer = new StreamWriter("important.txt"))
{
writer.Write(name + "," + socialid + "," + town + "," + numsold);
}
是否可以将下部元素乘以1,将上部元素乘以2?在现实世界中,我无法区分元素是由哪个发布者产生的。
答案 0 :(得分:1)
好的。都使用map()
运算符:
Flux<Integer> lower = Flux.just(1, 2, 3, 4, 5).map(i -> i * 1); // completely unnecessary, but you asked for it
Flux<Integer> upper = Flux.just(6, 7, 8, 9, 10).map(i -> i * 2);
Flux<Integer> total = Flux.concat(lower, upper);
total.subscribe(n -> System.out.println(n));