Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to use something similar to c# 's at quoting (@" ") in java [duplicate]

Tags:

java

string

c#

In C#, if you want to read a string without having to escape the characters, you can use an at-quote

String file = @"C:\filename.txt"

which is equivalent to

String file = "C:\\filename.txt"

Is there a simple way to escape an entire string in Java?

like image 990
amccormack Avatar asked Dec 11 '10 17:12

amccormack


People also ask

Is there an alternative to C?

The best alternative is Java. It's not free, so if you're looking for a free alternative, you could try C++ or Rust. Other great apps like C (programming language) are Go (Programming Language), C#, Lua and Perl.

Can C++ be used instead of C?

C++ can use templates and inline functions where C needs a macro. C++ overhead only appears when asked for, it is otherwise the same as C.

What languages is C similar to?

As a result, the development of various languages has been influenced by C language. These languages are C++ (also known as C with classes), C#, Python, Java, JavaScript, Perl, PHP, Verilog, D, Limbo and C shell of Unix etc.


1 Answers

No, unfortunately not.

As a side note: If you don't want to support Windows 9x and ME anymore, you can use "/" as folder separator. It works on all operating systems, including Microsoft Windows since 2000.

like image 199
Hendrik Brummermann Avatar answered Sep 27 '22 17:09

Hendrik Brummermann