作者:你不必害怕q因为我会发光 | 来源:互联网 | 2023-05-17 12:18
Considerthesource_folder_nameasD:\Desktop\testutil\configsqlInthecodegivenbelowthewhite
Consider the source_folder_name
as D:\Desktop\test util\config sql
In the code given below the white space in the folder name i.e test util
and config sql
is not handled properly. I need to escape those white spaces.
将source_folder_name视为D:\ Desktop \ test util \ config sql在下面给出的代码中,文件夹名称中的空格,即test util和config sql未正确处理。我需要逃离那些空白区域。
public class SqlToTblCoverter {
private File source_folder = null;
public SqlToTblCoverter(String source_folder_name) {
source_folder = new File(source_folder_name);
}
public void check() {
System.out.println("Source folder"+ source_folder);
}
}
public class test{
public static void main(String args[]){
Scanner in=new Scanner(System.in);
System.out.println("Enter Input Folder Path");
String input=in.next();
SqlToTblCoverter config_migrator = new
SqlToTblCoverter(input);
}
}
On executing the above code the value of source_folder comes is
在执行上面的代码时,source_folder的值是
Source folder: D:\Desktop\test
源文件夹:D:\ Desktop \ test
whereas expected is
而预期的是
Source folder: D:\Desktop\test util\config sql
源文件夹:D:\ Desktop \ test util \ config sql
Please help me out
请帮帮我
1 个解决方案