File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to remove \ from a String

 
Qarabagi Jaan
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
How to remove \ from a String.
I used
But I got java.util.regex.PatternSyntaxException.
Thanks in advance
Qarabagi
 
Keith Lynn
Ranch Hand
Posts: 2399
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to add two more slashes in the first String. The pattern is sent to another class before it is processed, so you need to make sure you have enough escapes.
 
Edwin Dalorzo
Ranch Hand
Posts: 961
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This works for me:



Or according to Keith



Or the simple form



[ October 03, 2006: Message edited by: Edwin Dalorzo ]
[ October 03, 2006: Message edited by: Edwin Dalorzo ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64178
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not exactly what I'd call "advanced".
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic