C# null 판단-string.IsNullOrEmpty(s);

RudinP·2023년 3월 30일
0

Study

목록 보기
17/222

string.IsNullOrEmpty(s); 를 사용하면 된다.
s == null 은 좋지 않은 표현이다.

사실은 잘못 알고 있어서 C#은 s == null 사용해도 되는 줄 알았는데 (백준에서는 이걸 맞다고 처리해줌) VS에서는 null reference 오류가 나서 이유가 왤까 찾아보다가 알게 되었다.

profile
곰을 좋아합니다. <a href = "https://github.com/RudinP">github</a>

0개의 댓글