Available since Version 1.7.
Compares two paths with options to ignore different casing and different slashes.
Syntax
ComparePaths( path1, path2, [case_insensitive, slash_insensitive] )Arguments
- path1 (string): The first path.
- path2 (string): The second path.
- case_insensitive (boolean): Whether or not the comparison is case insensitive.
- Optional, defaults to true.
- slash_insensitive (boolean): Whether or not the comparison is slash insensitive.
- Optional, defaults to true.
Return Values
- (boolean): Whether the paths match.
Examples
-- Result is true
local Result = ComparePaths("art\\cars\\famil_v.p3d", "art/cars/famil_v.p3d")
-- Result is false, the capitalization is different.
local Result = ComparePaths("ART\\CARS\\FAMIL_V.p3d", "art/cars/famil_v.p3d", false)
-- Result is false, the slashes are different.
local Result = ComparePaths("ART\\CARS\\FAMIL_V.p3d", "ART/CARS/FAMIL_V.p3d", true, false)Version History
Version 1.19
Fixed an issue where the ComparePaths function was always case sensitive and always slash sensitive.