code: public static void printCharacters(String s)
      {
          if(s != null)
          {
              logger.info("string length="+s.length());
              for(int i = 0; i < s.length(); i++)
              {
                  char c = s.charAt(i);
                  logger.info("char["+i+"]="+c+" ("+(int)c+")");
              }
          }
      }
docs: Prints the character codes for the given string.
  @param s The string to be printed