protected String removenullbyte(String thestring)
    {
        try
        {
        byte[] stringbyte = thestring.getBytes("ISO8859-1");
        int a = 0;
        while(stringbyte[a] != 0x00)
            a++;

        return thestring.substring(0, a);
        } catch (Exception e){

        }
        return null;
    }