C#문자열EndsWith

EndsWith문자열

지정 문자열로 끝나는지 확인합니다.

문법

str.EndsWith(value, comparisonType?)

예제

아래 값을 입력하면 예제에 즉시 반영됩니다.

string
filename
isPdf
EndsWith
Console
WriteLine
string filename = "report.pdf";
bool isPdf = filename.EndsWith(".pdf");
Console.WriteLine(isPdf);   // True