문자열 연결

// 1. +를 사용한 문자열 처리
string strPlus = "Hello " + userName + " .Today is " + date + ".";

// 2. Format을 사용한 문자열 처리
string strFormat = String.Format("Hello {0}. Today is {1}.", userName, date);

 **// 3. 보간을 사용한 문자열 처리** 
string strInterpolation = $"Hello {userName}. Today is {date}.";

// 4. Concat, Join을 사용한 문자열 처리
string strConcat = String.Concat("Hello ", userName, ". Today is ", date);

문자열 처리

  1. 확장자를 제외한 파일명만 따오기
selectedItem.Substring(0, selectedItem.LastIndexOf("."));
  1. 경로에서 파일명을 제외하기
System.IO.Path.GetDirectoryName(filePath)
출처: <https://wookoa.tistory.com/416> [Wookoa:티스토리]출처: <https://wookoa.tistory.com/416> [Wookoa:티스토리]

[C#] 파일경로 추출하기(파일명/확장자/파일경로)