Choose a Product Community
Resources

## If a network path contains \$ sign, how to access that path using groovy?

SOLVED
Occasional Contributor

## If a network path contains \$ sign, how to access that path using groovy?

As of now , I am mapping that network drive to a local drive in my system, list below:

File f = new File("A:\\Private\\Test\\")

But in actual network drive path I have a \$ sign like, \\opscif\\\$operation. If I write like below, I get error.

File f = new File("\\opscif\\\$operation\\Test\\")

Regular Contributor

The dollar is a special sign in Groovy and has its function in double-quoted "strings".

You have two options:

• use single quotes, such as 'hello\$'
• use double quotes with a backslash before the dollar sign, i.e., "hello\\$"

Best regards,

Karel

Karel@apimate.eu
https://apimate.eu
cancel
Showing results for