在java中声明没有双斜线的路径! [英] Declaring paths without double slashes in java !

查看:189
本文介绍了在java中声明没有双斜线的路径!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨..



我想知道java是否有任何特殊字符来声明文件路径而不在每个目录之间使用双斜杠..



例如,



如果我想声明文件D:\ xmlfile.xml,我必须插入另一个斜杠,然后是它已经有的斜杠,它必须看起来像D:\\xmlfile.xml



但是在C#语言中有一个特殊的字符来考虑引用之间的所有字符。

因此在C#中可以声明相同的路径,如@D:\ xmlfile.xml,而不使用另一个斜杠..



所有我想知道的是,如果java在C#中有一个像@这样的特殊字符来考虑引用之间的所有字符!



提前谢谢!

解决方案

我不是Java专家,但我认为没有。 :-(



一些谷歌搜索足以说服我。


不,没有: http://docs.oracle.com/javase/specs/jls /se7/html/jls-3.html#jls-3.10.6 [ ^ ]


No。



Java与C#的逐字字符串相当于@ [ ^ ]

Hi..

I want to know if java has any special char to declare a file path without using double slashes between every directories..

As a example,

If I want to declare the file "D:\xmlfile.xml", I have to insert another slash followed by the slash it already has and it must be looks like "D:\\xmlfile.xml"

But in C# language it has a special char to consider all the chars between quotations.
Therefore in C# the same path can be declared like @"D:\xmlfile.xml" without using another slash..

All I want to know is if java has too a special char like "@" in C# to consider all the chars between quotations !

Thanks in advance !

解决方案

I'm not a Java expert, but I don't think there is. :-(

A few Google searches was enough to convince me.


No, there isn't: http://docs.oracle.com/javase/specs/jls/se7/html/jls-3.html#jls-3.10.6[^]


No.

Java equivalent of C#'s verbatim strings with @[^]


这篇关于在java中声明没有双斜线的路径!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆