IsPathRooted method of Path class returns a value indicating whether the specified path string contains absolute or relative path information.
if (Path.IsPathRooted(@"c:\temp\") == true)
{
Console.WriteLine("Path is absolute");
}
else
{
Console.WriteLine("Path is relative");
}
IsPathRooted returns a boolean value, why would you teach such ugly syntax and write "== true"?
ReplyDelete