Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
128 views
in Technique[技术] by (71.8m points)

c# - How to get this string concatenation correctly outputed?

How do i get this

Console.WriteLine("Koordinaattipiste " + (4,2) + " on kvandrantissa 1.");

to print

(4,2) 

instead of

(4, 2) 

with the space in between?

question from:https://stackoverflow.com/questions/65944327/how-to-get-this-string-concatenation-correctly-outputed

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Assuming that you unintentionally used a Tuple by enclosing the two values in brackets:

Console.WriteLine($"Koordinaattipiste ({x},{y}) on kvandrantissa 1.");

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...