String directory bug

I have string for a directory bug which is really weird. Below is the sample of the bug

Actual string is a path directory that I am not willing to show

image

What do you consider the bug?

This seems like normal behaviour. There are lots of special characters in strings that are ‘escaped’ by adding a forward slash infront of them, the extra slashes you see are just escaping the existing ones.

1 Like

For me, it seems like a bug. How can i remove the escape characters? because when I use activity Folder Exists, it will return as false where in fact, it does. The path directory of extra \ disrupts the flow.

You need to be more detailed then, cause I don’t see how / where you are generating this string, or how you are using it.

Escaping characters is totally normal and just a display thing, you might be identifying the wrong root cause for your issue.

This is core .NET behaviour, and standard across Microsoft for anything using Visual Studio or C# so I highly doubt there is an unreported bug related to this.

From the screenshot we would derrive that it was done within the immediate panel. The output is visualizing the escapes as mentioned by @Jon_Smith. the visualized escapes are not part of the variable value

Then you could test it e.g by the following or similar:

"\\Big Subfolder\Subfolder1\Subfolder2\Subfolder3\".contains("\\\\")

which is about checking if the unneeded escapes are present or not.

Feel free also to share with us other details like:

  • UiPth Studio Version
  • Project compatibility, Programming Language
  • UiPath.System.Activities Version

And the details to the Directory of Interest (e.g. screenshot from Windows Explorer Path)…

We also would highlight to crosscheck if the path really has to start with \\ and not with a drive letter

You are right. It is visualized from immediate panel.

“\Big Subfolder\Subfolder1\Subfolder2\Subfolder3".contains(”\\\\")

Gives FALSE as result

Studio Version: 23.8.0
Project compatibility: Windows
Programming Language: VB
System.Activities version: 24.10.8

Yes, it starts with “\\” because its from a server. It was working well last week

So, I think we’ve established that there is no bug and the double slashes are just a visual thing showing the escaped characters right?

So perhaps focus on what path you are trying to validate that is failing, there must be a mistake there instead?

So, the issue should now be explained.

If there is any other open issue, then let us know what is the overall goal. Feel free also to do some further analysis e.g.

  • by creating a new folder on the shared drive e.g. with the create folder activity
  • by checking an existing path e.g. with the folder exists activity

Hello @aqiffm,

“\\Big Subfolder\Subfolder1\Subfolder2\Subfolder3\”

The \\ you’re seeing is just string escaping in UiPath/.NET, not an actual broken directory path. The file system will still interpret it correctly.