rocket mass heater kickstarter
The moose likes Java in General and the fly likes Strip slashes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Strip slashes" Watch "Strip slashes" New topic
Author

Strip slashes

Emir Bugra Koksalan
Greenhorn

Joined: Aug 23, 2012
Posts: 9

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..


www.kodmanyagha.org
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 41098
    
  29
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

Joined: Aug 23, 2012
Posts: 9

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

Joined: Oct 13, 2005
Posts: 41098
    
  29
Well done sorting it out
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Strip slashes