OverviewExamples
string String.AbbreviateFilePath ( |
Returns an abbreviated file path given a maximum number of characters. If the file path exceeds the maximum number of characters, folder names will be removed from the path from the right hand side until its length is less than the specified number of characters. This removal will be replaced by "...".
Note: The filename will never be truncated, therefore if the path including the filename exceeds the maximum number of characters, the abbreviation will be as close as possible.
For example: String.AbbreviateFilePath("C:\\Program Files\\My Application Folder\\tips.txt",35);
Returns:
C:\Program Files\...\tips.txt
Because this path is the smallest path that does not exceed 35 characters in length.
(string) The file path you want to abbreviate.
(number) The maximum number of characters to use in the abbreviated path.
(string) A new file path based on the specified number of characters. You can use Application.GetLastError to determine whether this action failed, and why.
See also: Related Actions