Created
August 2, 2015 13:51
-
-
Save lisysolution/54123b9c6196a62c00a8 to your computer and use it in GitHub Desktop.
C# 6.0 새기능 - 문자열 내에 코드 서식 직접 삽입 가능
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rectangle r = new Rectangle(); | |
r.Height = 10; | |
r.Width = 32; | |
// Format string 앞에 $ 를 붙인다 | |
// {} 안에 속성 혹은 계산식 등을 넣을 수 있다. | |
string s = $"{r.Height} x {r.Width} = {(r.Height * r.Width)}"; | |
Console.WriteLine(s); | |
// <결과> | |
// "10 x 32 = 320" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment