7 Replies Latest reply: Dec 19, 2007 8:44 AM by 807603 RSS

    get the attributes of a string

      I need to find the attributes of a given string variable

      when I system.print.out a variable, it looks like a "0"
      but when I say if var == "0" it seems to be false

      what I do:
      I read an xml file in with : XMLfileContent = FullyReadAFile.readFullyAsString(Location,"UTF8");
      this returns a byte[] buffer

      I substring this and find my value, and set my string variable = this value
      I think this value still has some information from the byte buffer, so is not completely == "0"

      how can I then convert back to an integer then to a string, i tried this:
       //i think myVar at this point is the byte 0
                try {
                int Volume = Integer.parseInt(MyVar);
                MyVar = "" + Volume;
           }catch (Exception Ex){System.out.println("Error :"+ Ex);}
      but it still was not equally to the string "0", even though it prints out as 0

      Edited by: Mr_Tuition on Dec 19, 2007 3:55 AM