• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

help

 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author and iconoclast
Posts: 24203
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do you mean by "remove" them? Do you want a much shorter string which doesn't include the nonprinting characters, or something else?
 
parthiban subramaniam
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic