code from pdf messing the quotes

Hi,

When i copy paste the code from pdf ebook tutorial  on java the quotes getting messed up as below

arr.insert(“john”, “T”, 43);
I have to correct as below everytime.
arr.insert("Yee", "To", 43);

How to fix this issue without manually doing 100 different times and places. Please advise any tip on this. what other things are best practices while executing and getting code from pdf ebook to practice.
LVL 7
gudii9Asked:
Who is Participating?
 
ozoCommented:
Scanner in = new Scanner(System.in);
while ( in.hasNext() ){
      System.out.println(in.nextLine().replace('“','"').replace('”','"'));
}
0
 
gudii9Author Commented:
when i copy say test.java from pdf(javaTutorial.pdf) file to eclipse(say test.java) i am getting this error. Not sure where can i use this code as my problem is much higher level. May be shall i copy paste from pdf to notepad++ then copy paster from there to eclipse which won't mess the quotes? please advise
0
 
ozoCommented:
Use the copy from pdf as the input to the above program, then take the output of the above program and paste it into eclipse.
0
 
gudii9Author Commented:
Use the copy from pdf as the input to the above program, then take the output of the above program and paste it into eclipse.

i am reading a pdf ebook which is of 1000 pages. I see code snippets in some pages. I am trying to copy from pdf then paste in eclipse for practice purpose. When i do this all " " are messing up. I do not understand clearly what you meant. can you please advise
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.