In Linux, the path separator is /, in windows supports both / and , so you can just use forward slashes to make your script cross-platform(Linux, UNIX, Mac OS X). instead of using DIRECTORY_SEPARATOR
I just learned that, to specify file names in a portable manner, you DON’T need ‘DIRECTORY_SEPARATOR’ – just use ‘/’. This really surprised and shocked me, as until now I typed about a zillion times ‘DIRECTORY_SEPARATOR’ to stay platform independent – unnecessary. Don’t make the same mistake.
I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.
I am Arjun from Hyderabad (India). I have been working as a software engineer from the last 7+ years, and it is my passion to learn new things and implement them as a practice. Aside from work, I like gardening and spending time with pets.