티스토리 뷰

c#

[wpf/c#/unity/winform] 변수 이름 가져오기

개발자 고포고 2021. 11. 25. 13:36
반응형
string test = "helloworld";
Debug.Writeline(nameof(test));

output:test

nameof 키워드를 이용하면 현재 나의 변수이름을 가져올 수 있다.

 

#c# #unity #winform #wpf #nameof #변수이름 가져오기

반응형
댓글
반응형