• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Strip slashes

 
Emir Bugra Koksalan
Greenhorn
Posts: 9
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody. I'm getting a java object as json by gson package but there is a problem. Gson returns an object like this:



I must convert this like that:



Please help meeee... Thanks..
 
Campbell Ritchie
Sheriff
Posts: 48382
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

Does that mean you are returned a String containing those backslashes? Have you come across the methods in the String class for replacing characters or substrings?
 
Emir Bugra Koksalan
Greenhorn
Posts: 9
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks

i found the problem. my variable's type is String and struts adding slashes. I changed the variable type and solved

Thanks for reply.. Have a nice programmings...
 
Campbell Ritchie
Sheriff
Posts: 48382
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well done sorting it out
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic