“\\” Path String

roengrit_much
Jul 21, 2017 · 1 min read

การจัดการกับ \\ ใน path หรือ string อื่นๆในโปรแกรมควร ใช้ @ ขึ้นต้น เพื่อให้สามารถใช้ \ เพียงตัวเดียว

string pathFile = "C:\\directory\\myfile.txt";

vs

string pathFile = @"C:\directory\myfile.txt";
)
Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade