Modding Tools > Lucas' Simpsons Hit & Run Mod Launcher > Hacks > Mod Requirable Hacks > Custom Files > Custom Lua Functions > General Functions > FixSlashes

FixSlashes

Returns a version of the given path with modified slashes.

Syntax

FixSlashes( <path>, [<to_windows>, <from_windows>])
  • path: The path to modify.
  • to_windows: Convert the path to have back slashes (\).
  • from_windows: Convert the path to have forward slashes (/).

Examples

--- Returns "scripts/missions/level01/level.mfk"
local Path1 = FixSlashes("scripts\\missions\\level01\\level.mfk", false, true)

--- Returns "scripts\missions\level01\level.mfk"
local Path2 = FixSlashes("scripts/missions/level01/level.mfk", true, false)

Notes

Only one of the 2nd and 3rd arguments should be set to true.

Version History

Unknown Version

Added this function.

Donut Team © 2024 · v4.0