PDA

View Full Version : Suggestion: new function String.AppendPath


SetupJuggler
08-20-2009, 09:02 AM
Hi,
using SUF 8.1.1008.0

it would be nice to have a string function to append ("concatenates") two paths together and returns the result as a new string, like String.Concat. It would be nice not to think about leading or trailing backslashes when using variables.


resultPath = String.AppendPath( PathStart, PathToAppend )

-- sample
PathStart = "c:\\tmp";
PathToAppend = "folder";
resultPath = String.AppendPath( PathStart, PathToAppend )
-- resultPath = "c:\\tmp\\folder"
PathStart = "c:\\tmp\\";
PathToAppend = "\\folder";
resultPath = String.AppendPath( PathStart, PathToAppend )
-- resultPath = "c:\\tmp\\folder"


I know String.MakePath could do this with Filename set to the path to append, but String.AppendPath would be closer to the task to do.

Greetings,

Udo

Darryl
08-24-2009, 10:34 AM
Thanks for the suggestion. REF: 18929

In case you weren't aware, you can also perform string concatenation using ".." instead of using actions.