This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Replace Question Mark  RSS feed

 
Ragupathirajan Venkatesan
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,

I need to parse one xml file. while doing so I need to replace the ? with empty string.


for example,



please help to solve the issue. thanks in advance.


 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just skip the special meaning of ? using backslash '\'.
 
Campbell Ritchie
Sheriff
Posts: 55324
157
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may need to escape the backslash too, so try changing ? to \\?
 
James Sabre
Ranch Hand
Posts: 781
Java Netbeans IDE Ubuntu
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it is simple as replacing each '?' with an empty string then there is no need for replaceAll(), just use


Edit : Thinking about this, it looks to me like the OP has parsed an XML file using the wrong character encoding and now need to get rid of the resulting '?' that are created when the encoder does not recognise some bytes as characters.
 
Ragupathirajan Venkatesan
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,
Thanks a lot. It works for me.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!