# SimplifyPath

## Description

Removes any occurrences of ../ or ..\ and shortens the path appropriately by removing folders. Also replaces all back slashes with forward slashes, as forward slashes will work on any platform. This works with both relative and absolute paths, if the path is absolute then all occurrences of ../ will be removed even if there are too many. If the path is relative then any occurrences of ../ that start the path will not be removed. For example the relative path "../../MyFile.txt" cannot be simplified further, whereas "C:/../../MyFile.txt" will be converted to "C:/MyFile.txt". The path may begin with the prefix "raw:" or not, both are accepted. If you are using this function in Tier 2 then you must delete the returned string with agk::DeleteString() when you are done with it.

## Definition

string SimplifyPath( szPath )

char* agk::SimplifyPath( const char *szPath )

## Parameters

- szPath - The path to simplify