• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps the backslesh operator '\' is not '\\', does it work?

jon80

Member
Just dry running the code, and, I wonder why C:\ won't trigger the usual error message as there has not been a double '\\' as in the rest of the string.

## This file is automatically generated by Android Studio.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Fri Dec 26 09:39:04 CET 2014
sdk.dir=C\:\\Users\\Administrator\\AppData\\Local\\Android\\sdk

(local.properties of a sample application).

See http://docs.oracle.com/javase/tutorial/java/data/characters.html and scroll down to the unlabeled table on backslash operators.
 
Because the path is C:\Users\etc but probably you are not allowed to use a colon in the path normally so you have to write it as \:

Same with the backslash, you write it as \\
 
Back
Top Bottom