java - How do I prevent the removal of a slash from an input String? -


the user inputs string corresponding file path. however, since java automatically removes \, have put 2 \'s. how can make them input string c:\path\filename.txt without needing worry adding apostrophes or additional slashes or whatever?

public string getdescriptorpath(){     return this.textfield.gettext(); } 

allow me clarify: user types textfield.

let's types: "c:\users\daniel.bak\box sync\descriptor analyzer\analyzeme.xml"

that comes out "c:usersdaniel.bakbox syncdescriptor analyzeranalyzeme.xml"

i adding slashes here because stackoverflow same thing.

i'm little confused mean, when take jtextfield , print it's contents gives me exact same see on screen.

contents of jtextfield: "c:\path\file.txt"
terminal output: "c:\path\file.txt"

this string should valid make file out of it, or want process it.


Comments

Popular posts from this blog

javascript - How to diff two immutable objects -

c# - How can I have the VS Debugger break in the correct location for exceptions thrown in Async methods in a Console App? -

javascript - React.js: onClick function from child to parent -