Probleme with string encoding

   Hello,
I have an application in Flex3 and when I send an Soap Query, I have a corect enveloppe,
but when I try the same code in Flex 4, the sting is encoding :
exemple :
Flex 3 :
  <ns1:orderLine>
      <ns1:line_nr>2</ns1:line_nr>
      <ns1:productCode>7443</ns1:productCode>
      <ns1:quantity>20</ns1:quantity>
     </ns1:orderLine>
Flex 4 :
  <ns1:orderLine>
      <ns1:line_nr>1</ns1:line_nr>
      <ns1:productCode>&lt;productCode xmlns=&quot;http://emt.netsoa.netinfluence.com/types/order">7505</productCode></ns1:productCode>
      <ns1:quantity>20</ns1:quantity>
     </ns1:orderLine>
The integer is correct, but the string fail.
How can i correct this ?
Jean

Your flex 4 response is translated as below after replacing reserved xml characters.  -
  <ns1:orderLine>
      <ns1:line_nr>1</ns1:line_nr>
      <ns1:productCode><productCode xmlns="http://emt.netsoa.netinfluence.com/types/order">7505</productCode></ns1:productCode>
      <ns1:quantity>20</ns1:quantity>
     </ns1:orderLine>
its strange that a productCode element came under the productCode element itself. Can you check if this was possibly due to the server returning a malformed response. help in this link -
http://anirudhs.chaosnet.org/blog/2009.06.01.html
I can analyze this if you provide the soap packet dumps

Similar Messages

  • Problems with string encoding - need the text content in char* format.

    The problem is non ASCII-characters, which comes out as some sort of unicode I need to desipher.
    Here's what I got:
    A text frame object with the TextString "Agnartjørna"
    I get the text content of this object into an ai::UnicodeString the following way:
    AIErr
    VMGetTextOfTextArt( AIArtHandle textArt, ai::UnicodeString &ucStr)
        ASUnicode *textBuffer = NULL;
        AITRY {
            TextFrameRef ateTextRef;
            AIX( sAITextFrame->GetATETextFrame( textArt, &ateTextRef));
            ATE::ITextFrame ateText( ateTextRef);
            ATE::ITextRange ateRange = ateText.GetTextRange( true);
            ASInt32 textLen = ateRange.GetSize();
            AIX( sSPBlocks->AllocateBlock( (textLen+2) * sizeof( ASUnicode), nil, (void**) &textBuffer));
            ateRange.GetContents( textBuffer, (ASInt32) textLen+1);
            /* trim off trailing newlines */
            if ((textBuffer[textLen] == '\n') || (textBuffer[textLen] == '\r'))
                 textBuffer[textLen] = 0;
            ucStr.clear();
            ucStr.append( ai::UnicodeString( textBuffer, textLen));
            sSPBlocks->FreeBlock( textBuffer);
            textBuffer = NULL;
           AIRETURN;
        AICATCH {
            if (textBuffer) sSPBlocks->FreeBlock( textBuffer);
           AIPROPAGATE;
    Now, the next step is to convert it into a form that I can use to call regexp.
    Baiscally, I want to detect the ending "tjørna" (meaning small lake) on a map label, and apply a standard abbevriation "tj^a" (with "a" superscripted).
    So the problem is to obtain the regexp pattern and the text content in same encoding.  And since the regexp library is old *char based, I would like to convert the text content in to plain old *char.
    Hence the following code:
    static AIErr
    VMAbbreviateTextArt( AIArtHandle textArt,
                             vmTextAbbrevEffectParams *params)
        AITRY {
        /* first obtain the text contents of the textArt */
           ai::UnicodeString ucText;
          const int kTextLen = 256;
          char textContent[kTextLen];
          AIX( VMGetTextOfTextArt( textArt, ucText));
          ucText.as_Roman( textContent, kTextLen);
    But textContent now has the value "Agnartj\xbfnna"  (According to XCode),
    which will not get a match on the pattern "tj([øe][rn])na\\" (with  backslash matching the end of the string)
    Any other ways to convert the textContent to a plain *char string?

    Thank you very much, your method will work fine. with
    the "UTF-8" parameter the byte[].length is double,
    cause every valid byte is preceeded by an -62, but I
    will just filter the valid bytes into a new array.
    Thanks again,
    StefanActually what you need to do is to find the character encoding that your device expects, and then you can code your strings in Arabic.
    That's the way Java does things; Strings and char values are always in UNICODE (see www.unicode.org) (which means \u600 to \u6ff for arabic) and uses a specified character encoding when translating these to and from a byte stream.
    Each national character encoding has a name. Most of them are identical to ASCII for 0-127 and code their national characters in 128-255.
    Find the encoding name for your display and, odds are, the JRE has it in the library.
    BTW the character encoding ISO-8859-1 simply maps UNICODE characters 0-255 on to bytes.

  • Little problem with Strings.

              I have an little problem with Strings, i make one comparision like this.
              String nombre="Javier";
              if( nombre.equalsIgnoreCase(output.getStringValue("CN_NOMBRESf",null)) )
              Wich output.getStringValue("CN_NOMBRESf",null) is "Javier" too, because I display
              this before and are equals.
              What I do wrong?.
              

    You are actually making your users key in things like
    "\026"? Not very user-friendly, I would say. But
    assuming that is the best way for you to get your
    input, or if it's just you doing the input, the way to
    change that 4-character string into the single
    character that Java represents by '\026', you would
    use a bit of code like this:char encoded =
    (char)Integer.parseInt(substring(inputString, 1),
    16);
    DrClap has the right idea, except '\026' is octal, not hex. So change the radix from 16 to 8. Unicode is usually represented like '\u002A'. So it looks like you want:String s = "\\077";
    System.out.println((char)Integer.parseInt(s.substring(1), 8));Now all you have to do is parse through the String and replace them, which I think shouldn't be too hard for you now :)

  • Problem with String variable

    I am new to Java Programming.
    I have a line of code that works and does what is supposed to.
    faceData.getProfile("Lisa").removeFriend("Curtis");
    If I assign the strings to variables such as-
    String name = "Lisa";
    String fName = "Curtis";
    and then plug those into the same line of code, it does not work
    faceData.getProfile(name).removeFriend(fName);
    What could be causing the problem?
    I even added some lines to print out what is stored in the variables to verify that they are what they should be, but for some reason the variables do not work while putting the strings in quotes does. Any ideas?

    I guarantee that something about your assertions are incorrect. Those variables are either not equal to the values you claim, or something else is going on. But it's not a problem with string variables versus string constants.
    Edit: My best guess in lack of a real example from you, is that the strings in question have non-printable characters in them, such as trailing spaces or line feeds.

  • Problem with String to Int conversion

    Dear Friends,
    Problem with String to Int conversion
    I am having a column where most of the values are numeric. Only 4 values are non numeric.
    I have replaces those non numeric values to numeric in order to maintain the data type.
    CASE Grade.Grade  WHEN 'E4' THEN '24'  WHEN 'E3' THEN '23'  WHEN 'E2' THEN '22' WHEN 'E1' THEN '21' ELSE Grade.Grade  END
    This comes the result as down
    Grade
    _0_
    _1_
    _10_
    _11_
    _12_
    _13_
    _14_
    _15_
    _16_
    _17_
    _18_
    _19_
    _2_
    _20_
    _21_
    _22_
    _23_
    _24_
    _3_
    _4_
    _5_
    _6_
    _7_
    _8_
    _9_
    Refresh
    Now I want to convert this value to numeric and do some calculation
    So I changed the formula as below
    cast (CASE Grade.Grade  WHEN 'E4' THEN '24'  WHEN 'E3' THEN '23'  WHEN 'E2' THEN '22' WHEN 'E1' THEN '21' ELSE Grade.Grade  END as INT)
    Now I get the following error
    View Display Error
    _     Odbc driver returned an error (SQLExecDirectW)._
    Error Details
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    _State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 17001] Oracle Error code: 1722, message: ORA-01722: invalid number at OCI call OCIStmtFetch. [nQSError: 17012] Bulk fetch failed. (HY000)_
    SQL Issued: SELECT cast ( CASE Grade.Grade WHEN 'E4' THEN '24' WHEN 'E3' THEN '23' WHEN 'E2' THEN '22' WHEN 'E1' THEN '21' ELSE Grade.Grade END as Int) saw0 FROM "Human Capital - Manpower Costing" WHERE LENGTH(CASE Grade.Grade WHEN 'E1' THEN '20' WHEN 'E2' THEN '21' WHEN 'E3' THEN '22' WHEN 'E4' THEN '23' ELSE Grade.Grade END) > 0 ORDER BY saw_0_
    Refresh
    Could anybody help me
    Regards
    Mustafa
    Edited by: Musnet on Jun 29, 2010 5:42 AM
    Edited by: Musnet on Jun 29, 2010 6:48 AM

    Dear Kart,
    This give me another hint, Yes you are right. There was one row which returns neither blank nor any value.
    I have done the code like following and it works fine
    Thanks again for your support
    Regards
    Code: cast (CASE (CASE WHEN Length(Grade.Grade)=0 THEN '--' ELSE Grade.Grade END) WHEN 'E4' THEN '24' WHEN 'E3' THEN '23' WHEN 'E2' THEN '22' WHEN 'E1' THEN '21' when '--' then '-1' ELSE Grade.Grade END as Int)

  • Problem with RPC/encoded WSDL

    I'm having trouble calling a web service that is based on an RPC-encoded WSDL. I've already made slight changes to the WSDL, so that I get a work-able message type for mapping purposes. These changes are based on <a href="http://www.ws-i.org/Profiles/BasicProfile-1.0-2004-04-16.html#refinement16556272"><b>soapenc:Array</b> recommendations in WSDL 1.1 Section 2.2</a> for declaration of array types.
    Here's a snippet of the WSDL:
    <wsdl:definitions ...> 
      <wsdl:types>   
        <schema ...>
          <complexType name="ArrayOf_tns1_ServiceOption">
            <complexContent>
              <restriction base="soapenc:Array">
                <attribute ref="soapenc:arrayType"
                  wsdl:arrayType="tns1:ServiceOption[]"
                  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/>
              </restriction>
            </complexContent>
          </complexType>
        </schema>
        <schema ...>
          <complexType name="ServiceOption">
            <sequence>
              <element name="key" nillable="true"
                        type="xsd:string"/>
              <element name="value" nillable="true"
                        type="xsd:string"/>
            </sequence>
          </complexType>
        </schema>
      </wsdl:types>
    </wsdl:definitions>
    I've changed it to:
    <wsdl:definitions ...> 
      <wsdl:types>   
        <schema ...>
          <complexType name="ArrayOf_tns1_ServiceOption">
            <sequence>
              <element name="ServiceOption"
                        type="tns1:ServiceOption"
                        minOccurs="0" maxOccurs="unbounded"/>
            </sequence>
          </complexType>
        </schema>
        </schema>
        <schema ...>
          <complexType name="ServiceOption">
            <sequence>
              <element name="key" nillable="true"
                        type="xsd:string"/>
              <element name="value" nillable="true"
                        type="xsd:string"/>
            </sequence>
          </complexType>
        </schema>
      </wsdl:types>
    </wsdl:definitions>
    The above changes have allowed me to make message mappings. But the I still get an error when sending a request to the web service. It seems that it requires the <b>xsi:type</b> and <b>soapenc:arrayType</b> attributes for arrays.
    <b>How can I create these attributes? How does XI handle RPC-encoded WSDLs?</b> I haven't encountered these problems with document-literal WSDLs.
    Thanks in advance.

    Hi Lorenzo,
    the extended support of rpc-style does <b>not</b> include the support of soapenc:array. It just addresses the root of the message and its direct children (as discussed in the thread where I added this hint).
    In the documentation of External Definitions you can find a hint where to find a list of supported XSD/DTD/WSDL-features. However, also there you will find no hint on the fact that soapenc:array is not supported. The reason for this is, that soapenc:array is specified in none of these standards. It is some artifact that SOAP smuggled into XSD. For good reasons WS-I prohibits the use of this artifact.
    Hence, if you need support for argumentation I can only point out the WS-I document I already linked.
    Greetings
    Stephan

  • Problem with String in a Vector

    I'm making a small hangman game. And I got a problem with putting words in a Vector... This is the code... Can someone tell me what I'm doing wrong?
    // First I define it.
    Vector Words;
    //  Then add the words
    Vector Words = new Vector();
    Words.add(new String("HELLO"));
    Words.add(new String("GOOD BYE"));
    // When I try to get a string from the Vector I use this.
    // The program compiles but when I try to run it I get NullPointerExeption here
    W = (String) Words.elementAt(0);

    Not sure since I cant see all of your code but looks like this might be your problem:
    // First I define it.
    Vector Words; //<-- here you define a Vector named Words that is null
    // Then add the words
    Vector Words = new Vector(); //<-- here you define another vector named Words that holds a reference to a new Vector. This is a different reference than the one created above so you should probably remove the "Vector" part from the beginning of this line. Is this a local variable to a method and the one before is a global variable?
    //Here you probably access the locally created Words vector which is initialized
    Words.add(new String("HELLO"));
    // When I try to get a string from the Vector I use this.
    // The program compiles but when I try to run it I get NullPointerExeption here
    W = (String) Words.elementAt(0); //<--and here my guess is that this statement is inside another method than the one with the local Words vector defined. Thus this one accesses the global Words Vector that is never initalized and is Null. And that gives you the NullPointerException.
    So try changing the statement
    Vector Words = new Vector();
    to
    Words = new Vector();
    or just remove it totally and move the Vector creation to the place where you introduce the global variable.
    Of course I might be totally wrong since I cant see all of your code but that is my guess.
    Hope it helps,
    -teka

  • Problem with file.encoding in Linux

    Hello,
    I am currently migrating a java project from Windows to Linux. The project is finally shaping up now, except for some encoding problems.
    All configuration files are saved in ISO-8859-1/Cp1252 format. When reading and displaying these files in Swing (e.g. JTextArea), the special characters ���� are displayed wrong. I have tried to start the VM with -Dfile.encoding=ISO-8859-1 and -Dfile.encoding=Cp1252 without success (this is done in Eclipse under Linux).
    I then tried the opposite. I created some UTF-8 files, started the application under Windows/Eclipse, read the files and displayed them in a JTextArea. Garbage characters were shown instead of ���� (as expected). I then used -Dfile.encoding=UTF-8, and voila, all characters were displayed correctly.
    Why does not -Dfile.encoding work for ISO-8859-1/Linux but -Dfile.encoding work for UTF-8/Windows? Anyone here know?
    The JRE I have been using is 1.4.2_06.
    The Linux is a SuSE 10.0

    Continue the "discussion" here:
    http://forum.java.sun.com/thread.jspa?threadID=737153

  • StringTokenizer class problem with strings in double quotes

    Hello Technocrats,
    I have a problem with tokenizing following string enclosed in (). (abc," India, Asia", computer engineer). My separator is ",", thus StringTokenizer class gives me 4 tokens namely abc, "India, Asia" and computer engineer. But I require that String in double quotes should be a single token. How to achieve this using StringTokenizer class? Or is there any other way?
    Thanks in advance.

    Try
    String[] str="abc,\" India, Asia\",computer engineer".split(",",1);
              for(String s: str)
                   System.out.println(s);
              }Thanks.

  • Problems with H264 encoding -- corrupted files...

    In Media Encoder CS5 I tried to export my Premiere Pro CS5 sequence with H264 encoding(30 fps, progressive, CBR 6 mbps, 640 x 480). Audio(AAC,  48 kHz, 256 kbps). It have made a corrupt video file(with 2 GB size, and it should be ~3,5 GB). I tried to re-export with these settings, and now the size was 1045 MB. Again corrupted file, it cannot be played... The Media Encoder says that there is no errors, the rendering was successful. After several other tries with different settings, I cannot render my movie.
    What can I do?
    Thanks for help!
    Daninet

    Hello all,
    This is an old thread, but it's an old problem that I'm concerned may still be continuing.
    We're moving from 3.2 to 4.1. While copying our applications from 3.2 to a test 4.1 installation, we did a static file export for "All static files" from 3.2 and did an import to 4.1. We're seeing the same behavior that I and others have reported in the past - any static files that are javascript are corrupted when "all static files" was chosen. Exporting/importing each javascript static file individually appears to work fine.
    If the bug was in 3.2 in that it was generating a corrupted export file when "all static files" is chosen, then I'm not concerned - we're moving from 3.2 anyway. But, if the issue is in the import then it must still exist in 4.1 and that would be a concern.
    Does anyone know if this was a recognized bug in 3.2 and has since been corrected?
    Thanks!
    John

  • Problems with JPEG encoding

    I'm making photo album on the web. But I have a problem with thumbnails generation. I have read alot about it on this forum (thanks guys) but I have a problem:
    Sometimes (but not every time) and independent on the image I've got thumbnail picture that can not be readed neither by IE or Photoshop or another programm. I'm using next encoding sequence:
    PEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
    com.sun.image.codec.jpeg.JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(bufferedImage);
    writeParam.setCompressionMode(JPEGImageWriteParam.MODE_EXPLICIT);
    param.setQuality(0.7f, true);
    encoder.setJPEGEncodeParam(param);
    encoder.encode(bufferedImage);
    And this code operate in the Servlet enviroment. So, I can not understand what is wrong?
    Renat.

    Hi Renat.
    I may be wrong but I have observed some troubles with JPEG encoding (particularly because of a lack of CPU)... You may have the same trouble... The problem is that I don't how to catch these errors but if someone knows how to, I would be really interested in... I can only catch them when I decode these images thanks to TruncatedFileException and ImageFormatException.
    Stephane.

  • Problema with strings as parameters

    I'm facing a curious problem. I have already downloaded a few classes that encode special characters into html entities. All of them receive a string paramter and return the encoded string.
    The problem is that if i pass an actual string as paramater, the result is ok. But if i pass a string variable as parameter, the functions don't work.
    I mean, if i use this:
    String str = HTMLTools.encode("Usu�rios");
    The result in str is "Usu&aacuterios" -> Correct
    On the other hand, if i use
    String str1 = "Usu�rios";
    String str = HTMLTools.encode(str1);
    The result in str is "Usu�rios" -> WRONG!!!!
    This is freaking me out!!! I'm going nuts. It's happened with almost ten different classes the same thing. Idon't know how to fix that.
    Does anybody has any clue?
    Thanks a lot to all.

    I mean, if i use this:
    String str = HTMLTools.encode("Usu�rios");
    The result in str is "Usu�rios" -> Correct
    On the other hand, if i use
    String str1 = "Usu�rios";
    String str = HTMLTools.encode(str1);
    The result in str is "Usu�rios" -> WRONG!!!!Um... this may be an accident of encoding it for a web
    page, but the value you assign to str1 appears to be
    wrong?You're right. This is a problem of encoding for a web page. That's why i have to encode the html entities, but i'm having no success on that.

  • Problem with URL encoding conversion

    Hi all,
    I am working on an I18N application and in my application one component sends the request to another component and then this component fetch that requet and extract the query-parameters from the request (HTTP request).
    Now the problem is that the input to first component can be given in one of the 5 character encodings:-
    UTF-8
    Shift_JIS
    EUC_JP
    Windows-31J
    ISO-2022-JP
    I have created a test program that convert the encoded URL from one character encoding to another character encoding. It is working successfully for the above 4 encodings but for the last encoding that is "ISO-2022-JP" this fails. The test programs is: -
    import java.io.*;
    import java.util.*;
    import java.net.URLDecoder;
    import java.net.URLEncoder;
    class JPtoUTF8{
         public static void main(String[] args){
              try{
                  String shift_jis = "%82%C8%82%A4%82%8B%82%E8";          // This is Shift_JIS encoded URL
                  String iso2022jp = "%1B%24B%24J%24%26%23k%24j%1B%28B";  // This is ISO-2022-JP encoded URL
                  String utf8 = "%E3%81%AA%E3%81%86%EF%BD%8B%E3%82%8A";   // This is the result that should be obtained
                  String decodedShift_jis = URLDecoder.decode(shift_jis,"Shift_JIS");
                  String decodedIso2022jp = URLDecoder.decode(iso2022jp,"ISO-2022-JP");
                  String encodedShift_JIS = URLEncoder.encode(decodedShift_jis,"UTF-8");
                  String encodedIso2022jp = URLEncoder.encode(decodedIso2022jp,"UTF-8");
                   System.out.println("shift_jis        = "+shift_jis);
                   System.out.println("encodedShift_JIS = "+encodedShift_JIS);
                   System.out.println("iso2022jp        = "+iso2022jp);
                   System.out.println("encodedIso2022jp = "+encodedIso2022jp);
              }catch(Exception e){
                   e.printStackTrace();
    }I am using jdk5 for this application.
    Please give your valuable suggestions.
    Thanks in advance.

    Could the cause be that ISO-2022-JP is not just ISO-2022-JP:
    http://www.w3.org/TR/japanese-xml/#AEN28427904
    Maybe what you are getting is one of the flavors, while the java urldecoder uses another flavor? Or maybe the string you are getting is incorrectly encoded to being with (might have been incorrectly converted from shift-jis)?
    With the shift-in shift-out design it is a difficult encoding to deal with under the best of circumstances, so you have my sympathy.

  • Problems with string tokenizer

    okay heres my problem, i have a textarea displaying a program listing and i have to extract variables i.e public int something;
    i have tried many different approaches but still the output is not what i was looking for. Can someone have a look at my code and check for mistakes that i cant find
    public void createDataDictionary() {
              if(fullText.equals("")) return;//do nothing if no text exists
              String checkText = fileContents.getText();//store text area contents into string
              String dataType = "";
              String variable = "";
              String accessModifier = "";
              StringTokenizer str = new StringTokenizer(checkText," \n", true);
              fileCheckBox.setText("");//clear file check box
              while(str.hasMoreTokens()) {//loop while there are more tokens to tokenize
                   try{                    
                        checkText = str.nextToken();
                        //check for comments
                        if((checkText.startsWith("//")) || (checkText.equals("//")) ||
                           (checkText.startsWith("/**")) || (checkText.equals("/**")) ||
                           (checkText.startsWith("*")) || (checkText.equals("*"))) {
                             isComment = true;                    
                        if((checkText.equals("\n"))) isComment = false;
                        if(!isComment)
                             //check for access modifiers
                             if((checkText.equals("public")) || (checkText.equals("private")) ||
                                (checkText.equals("protected"))) {
                                          accessModifier = checkText;
                                     }else {
                                          accessModifier = "";
                             //check for data types             
                             if((checkText.equals("boolean")) || (checkText.equals("char")) ||
                                     (checkText.startsWith("String")) || (checkText.equals("int"))) {
                                       dataType = checkText;
                                       variable = str.nextToken();//get variable expression
                                       System.out.println(accessModifier + " " + dataType + " " + variable);
                   }catch(NoSuchElementException nsee) {//not enough tokens to complete operation
                        JOptionPane.showMessageDialog(null, "End of file");
                        return;//break from method
         }here is sample text
    private String seven = "help";
    char five[];
    // String here
    //int found
    public boolean okay
    and here is the output
    String
    char
    String
    boolean
    //note the space before each output
    hope someone can help
    thanx in advance

    1. Why do you check to see if the token starts with
    //, /*, etc, etc. Later you check if the token
    equals private, public, protected. It couldn't
    equal if it started with a comment.if the token starts with a comment i dont want to read the rest of the line, so i set the isComment flag to true
    2. I strongly suggest that you do it line by line.
    Perhaps a string tokenizer that only tokenizes by
    lines, then within that loop, another that tokenizes
    by whitespace. i take it you mean putting the text into a bufferedreader and then using readLine()?? Bit new to string tokenization as you can possibly see
    i managed to get the small test text to work more or less as i wanted but when ever i load a large code listing, the results are erratic to say the least
    heres a section of this code
    private int textNum = 0;/**Integer used to hold the text position within any given line*/
         private int lineNum = 0;/**Integer used to hold the line number within any given file*/
         static boolean application = false;/**Used to track if applet is ran from a browser or JAR file*/
         static boolean fileOpened = false;/**Used to track if file has already been opened*/
         static boolean isComment = false;
         private char lCurve = '(';
         private char rCurve = ')';
         private char lCurly = '{';
         private char rCurly = '}';
         private char lSquare = '[';
         private char rSquare = ']';
         String fullText = "";and heres the output
    public int textNum //should be private!!!!
    int lineNum //missing private
    boolean application //missing static
    boolean fileOpened //missing static
    boolean isComment //missing static
    //all below missing private     
    char lCurve
    char rCurve
    char lCurly
    char rCurly
    char lSquare
    char rSquare
    String fullText //not there at all

  • Problems with String

    Hey All,
    I have this string "Straw? No, too stupid a fad, I put soot on warts" I am going to test is this string is a palindrome. Thi string is, but I run it through my program it says it is not because of the "?" and ",". How to take that string run it through something like a buffer or tokenizer to take out those things like "?" , "," and anything else. In the end I would like to have to remove all those types of characters and just run a string into the like I want to above to me change to this
    From:
    Straw? No, too stupid a fad, I put soot on warts
    To:
    Straw No too stupid a fad I put soot on warts

    You have to place a space in the replace(' ',' ') or it will not work. Plus it does not work with that, it just adds a space to what ever characeter I just replaced. Would a Stringtokenizer with a space delimiter take of my problem?

Maybe you are looking for