Two Laptop Bag*
The moose likes Java in General and the fly likes help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "help" Watch "help" New topic
Author

help

parthiban subramaniam
Ranch Hand

Joined: May 15, 2002
Posts: 116
hello all,
been banging my head over this ,
would appreciate if anyone could help.

I have a string which is been encoded in base64 algorithm,
When I decode it I get something like this

String decoded = "PARTHIRU3 \u0000u\u0001_C \u0018\u0000C \u0018\u0000\u0000t�o\u0000u\u0001_\u0000\u0000\u0000\u000F\u0000\u0000\u0000\u000F\u0000\u0000\u0000\u000F\u0000\u0000\u0000\u000F\u0000t�o\u0000u\u0001_C\u0000t�o\u0000u\u0001_ \u0000t�o\u0000u\u0001_ C\u0000t�o\u0000u\u0001_\u0000\u0000\u0000\u000F\u0000\u0000\u0000\u000F\u0000\u0000\u0000\u000F\u0000\u0000\u0000\u000F\u0000u\u0001_\u0000\u0000\u0000\u000FSO\u0000t�o\u0000\u0000\u0000u\u0001_\u0018\u0000A01\u0000t�o\u0000u\u0001_\u0000u\u0001_D\u0000u\u0001_\u0000u\u0019�\u0000u\u0001_S\u0000t�o\u0000u\u0001_ \u0000t�o\u0000u\u0001_ \u0000t�o\u0000u\u0001_E\u0005\u0000u\u0001_\u0000t�o\u0000u\u0001_S\u0000u\u0001_ \u0018\u0000\u0018\u0000\u0000t�o\u0000u\u0001_\u0000\u0000\u0018\u0000\u0000u\u0001_\u0018\u0000\u0000t�o\u0000u\u0001_\u0018\u0000C\u0000\u0000\u0018\u0000\u0000\u0000\u0018\u0000 T\u0000u\u0001_";


As you can see this string has lot of escape literals all over the place,(a mix of null, trademark etc)

In midst of the whole thing I have to extract bits and pieces of data,

1, how do I remove all the escape from this string?

Sincerely appreciate your efforts

Best regards,
Parthi


Even crazy and silly looking problems are sometimes real.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24168
    
  30

What do you mean by "remove" them? Do you want a much shorter string which doesn't include the nonprinting characters, or something else?


[Jess in Action][AskingGoodQuestions]
parthiban subramaniam
Ranch Hand

Joined: May 15, 2002
Posts: 116
yes,
i just want to strip out the non printable char's.
once they are removed they go in to bean,
for example

"PARTHIRU3" a part of that string will be split in to "PARTHI","R", "U3" etc

parthi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: help
 
Similar Threads
character interpretation
Writing my own length() method
Printing an array using nested for loops? (Code edited)
Groovy MultiLine strings and Java
Eclipse Europa and Eclipse web tools...