반응형
startsWith
이 글자로 시작하는지를 판단하는 메소드
https://docs.microsoft.com/ko-kr/dotnet/api/system.string.startswith?view=net-5.0
String.StartsWith 메서드 (System)
이 문자열 인스턴스가 지정한 문자로 시작하는지를 확인합니다.Determines whether this string instance starts with the specified character.
docs.microsoft.com
endsWith
이 글자로 끝나는지 판단하는 메소드
프로그램 확장자를 이름으로 판단하기에 좋다. (.zip, .xlsx...)
https://docs.microsoft.com/ko-kr/dotnet/api/system.string.endswith?view=net-5.0
String.EndsWith 메서드 (System)
이 문자열 인스턴스의 끝 부분과 지정한 문자열이 일치하는지를 확인합니다.Determines whether the end of this string instance matches a specified string.
docs.microsoft.com
'C#' 카테고리의 다른 글
[C#] Azure DownloadToStream 오류 (0) | 2021.08.23 |
---|---|
[C#] 대소문자 구분 없이 Contains 확인 (0) | 2021.07.07 |
[C#] JSON 항목 삭제가 불가능 할 때 삭제 하는 방법 (0) | 2021.07.01 |
[C#] 요소가 null 일 때 처리 (?., ?[], ??, ??=) (0) | 2021.06.08 |
[C#] char 형식으로 반복문 돌리기 (0) | 2021.05.16 |
댓글