• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 196
  • Last Modified:

Character class - Character types - What this type means?

Can anybody tell me what is meant by DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE(15) and SPACE_SEPARATOR(12)
I am trying to decode a string, but for the space character, I am getting a sequence like
Space - Character type 15,12,15
Between characters - 15.

So when i should get "Experts Exchange"
I am getting "E(15)x(15)p(15).....t(15)s(15)(12)(15)E(15)......(15)e

0
kumvjuec
Asked:
kumvjuec
  • 3
1 Solution
 
CEHJCommented:
>>I am trying to decode a string

How?
0
 
kumvjuecAuthor Commented:
5500730065002000740068006500730065

Every two characters here are hex representation on one charater. So the first character is to be represented by 55, 2nd by 00 and so on.
I want the string here to be "Use these"
0
 
CEHJCommented:
           String s = "5500730065002000740068006500730065";
            StringBuffer sb = new StringBuffer(s.length());
            for(int i = 0;i < s.length();i += 2) {
                  String atom = s.substring(i, i + 2);
                  if ("00".equals(atom)) {
                        continue;
                  }
                  else {
                        sb.append((char)Integer.parseInt(atom, 16));
                  }
            }
            System.out.println(sb);
0
 
objectsCommented:
public class Decode
{
      public static void main(String[] args)
      {
            StringBuffer result = new StringBuffer();
            String s = "5500730065002000740068006500730065";
            for (int i=0; i<s.length(); i+=4)
            {
               result.append((char)Integer.parseInt(s.substring(i, i+2), 16));
            }
            System.out.println(result);
      }
}
0
 
CEHJCommented:
8-)
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now