caubert
(Martin “caubert” Kauber)
February 10, 2019, 11:23pm
1
Hello…
my first post in this very helpful forum, so I try to make sense : )
My problem is. I don’t understand why does Println generate two extra bytes of whitespace in this code >
https://play.golang.org/p/PfvEE_TB_Ng
Really puzzled and I don’t know how to search for the answer as well, so any guidance would be great!
Thank you guys!
NobbZ
(Norbert Melzer)
February 10, 2019, 11:32pm
2
Because both functions work as documented. println always adds spaces, print only when at least one of the two neighbors is not a string.
4 Likes
Zyl1
(Zyl1)
February 11, 2019, 5:27pm
3
Println joins the arguments with spaces, while Print does not. (well, not always) You don’t need such a verbose example to see the difference: https://play.golang.org/p/nyLYT5wj8Da
serverok
(Yujin Boby)
February 14, 2019, 5:51am
4
Thank you @Zyl1 for simple example.
system
(system)
Closed
May 15, 2019, 5:51am
5
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.