StringTokenizer not working as I was expecting

Hi all, I have a question related to StringTokenizer class. It is not giving me the results I was expecting. May be my understanding is wrong.
This is my code:
String string = null;
String delimiter = null;
StringTokenizer tokenizer = null;
string = "Normal";
delimiter = "_crMULT_";
System.out.println("string=" + string);
System.out.println("delimiter=" + delimiter);
tokenizer = new StringTokenizer(string, delimiter);
while (tokenizer.hasMoreTokens()) {
     System.out.println("tokenizer.nextToken()=" + tokenizer.nextToken());
}This is the result I am getting:
string=Normal
delimiter=_crMULT_
tokenizer.nextToken()=No
tokenizer.nextToken()=mal
I thought this is the result I will get:
string=Normal
delimiter=_crMULT_
tokenizer.nextToken()=Normal
What I am doing wrong here?
Edited by: 962950 on Oct 3, 2012 10:12 AM

rp0428 wrote:
>
string=Normal
delimiter=_crMULT_
tokenizer.nextToken()=No
tokenizer.nextToken()=mal
>
The first delimiter character found in 'Normal' is 'r' so the first token is 'No'.
None of the other delimiter characters was found so the next, and last token is 'mal' since the 'r' was a delimiter and was stripped.The OP's confusion was thinking that the delimiter String was a single, multi-character delimiter, hence my reply.

Similar Messages

  • Hellow my i pod is not working.actually bettry was too low then i puted on charging.it starting charging but not going to power on.when it tried to starting on sunndly after the apple logo it showd the 5 % bettry and went back off and this proses is carry

    hellow
    my i pod is not working.actually bettry was too low then i puted on charging.it starting charging but not going to power on.when it tried to starting on sunndly after the apple logo it showd the 5 % bettry and went back off and this proses is carry on.plz help me how it witt work starting.i urgently need to on my i pod.plz help me plzzzzzzzzzzzzzzzz

    Hi there shehla sattar,
    I would recommend taking a look at the troubleshooting steps found in the article below.
    iPad: Basic troubleshooting
    http://support.apple.com/kb/ts3274
    -Griff W.

  • HT201272 To whom it may concern, This morning I purchased an album, on listening to it three of the tracks are not playing correctly. I read on an apple discussion board that I should delete them and re-download them. This did not work as I was asked to p

    To whom it may concern, This morning I purchased an album, on listening to it three of the tracks are not playing correctly. I read on an apple discussion board that I should delete them and re-download them. This did not work as I was asked to pay for them, and one of the tracks was an album only track.

    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • HT3964 Hello, my isight camer is not working properly, i was using photo booth and suddenly the image was black or too dark and also ichat and facetime are too dark as well, please helpme out i can not find any solution.

    Hello, my isight camer is not working properly, i was using photo booth and suddenly the image was black or too dark and also ichat and facetime are too dark as well, please helpme out i can not find any solution.

    read this and see if it helps: http://support.apple.com/kb/ht2090

  • TS1368 My Itunes match is not working right, it was only able to download 50% of my songs and now I can't play the balance songs.. it's so stupid

    My Itunes match is not working right, it was only able to download 50% of my songs and now I can't play the balance songs.. it has messed up my enitre music library

    Hello Carpathianna,
    No judgment here on the music you listen to, I have that song too in my library. If iTunes is telling you that the song is missing and you purchased it from the iTunes Store, then just delete it from your iTunes library and then download your song again. Check out the articles below for more information.
    How to delete content you've downloaded from the iTunes Store, App Store, iBooks Store, or Mac App Store
    http://support.apple.com/kb/HT5772
    Download past purchases
    http://support.apple.com/kb/HT2519
    Regards,
    -Norm G.

  • HondaLink Apps not working in iOS8, was working in iOS7

    HondaLink Apps not working in iOS8, was working in iOS7.  Any fix?

    Easy fix.  Rename your iPhone so that the word "iPhone" is not part of the name.
    Hondalink will immediately recognize the device.  Just spoke with Honda customer service and this is what they suggested.  It worked right away.

  • HT1657 i tried to rent a movie but it did not work and i was charged away. How can I have charges reversed?

    Hello,
    I tried to rent a movie but it did not work and I was charged away. How can I have charges reversed?

    Try the 'report a problem' page to contact iTunes Support : http://reportaproblem.apple.com
    If the 'report a problem' link doesn't work then you can try contacting iTunes support via this page : http://www.apple.com/support/itunes/contact/- click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • Hello I am using Ipad 4 and its charger is not working while I was using it few days before and it was working properly now it says that the cable does not support this Ipad Please Help me out.

    Hello I am using Ipad 4 and its charger is not working while I was using it few days before and it was working properly now it says that the cable does not support this Ipad Please Help me out.

    Try a reset:
    - Hold the home button and sleep/wake button down at the same time. When the Apple logo appears release both buttons then try and charge again.
    If issue persists try:
    - Another known working cable
    - Check the charging port for any damage or debris
    - You could also use a dry soft bristle toothbrush and gently brush it on the port to clean it of any debris that could be in there

  • My iPod touch 4g's screen cracked and tried to replace it by myself and it's not working and I was wondering if apple will repair it ?

    My iPod touch 4g's screen cracked and tried to replace it by myself and it's not working and I was wondering if apple will repair it ?

    Apple may or may not exchange your iPod for a refurbished one for this price. They do not fix yours.
    Apple - iPod Repair price      
    Make an appointment at the Genius Bar of an Apple store and find out.
    Apple Retail Store - Genius Bar          

  • Free transform not working in CC [was:PLEASE HELP ME!!!]

    Hello! Please, Please Help me! I installed Photoshop CC to edit my photo and when I use  free transformation it is not working. I need just to transform one litte area in the photo.
    I have windows 7 64 bits. Thank you!

    Chris, Thank you! I wanted to change the eye area, so when I selected the area and used free transformation tool, it did not work. Free transformation worked only for the whole image but not for the selcted area. I was using this video. May be I need some more plug ins. http://www.youtube.com/watch?v=KI8Ab213ejU

  • Hotmail in Safari not working since Yosemite was downloaded

    Good morning.
    I installed Yosemite (version 10.10.2) yesterday on my imac and since then cannot open Hotmail in Safari (everything freezes or once I got the message 'Safari can't find server').
    I was normally login in to hotmail using dub125.mail.live.com
    I have already cleared my search history. And one of the Apple chat help persons told me to do a safe reboot, which did not change anything.
    Any idea what I should do?
    Many thanks!

    Try a restart.
    Do a backup, using either Time Machine or a cloning program, to ensure files/data can be recovered. Two backups are better than one.
    Try setting up another admin user account to see if the same problem continues. If Back-to-My Mac is selected in System Preferences, the Guest account will not work. The intent is to see if it is specific to one account or a system wide problem. This account can be deleted later.
    Isolating an issue by using another user account

  • Acrobat X was not working, so I  was asked to uninstall and reinstall. I uninstalled , but now cannot install disc (no way to put DVD in new computer). How do I install??

    Acrobat X was not working. I uninstalled as asked, now am unable to reinstall the disc on new computer( no way to put a disc in the new cjmputer). How do I get Acrobat Pro back on my computer??

    Download from Download Acrobat products | Standard, Pro | XI, X

  • Explain Plan not working with 919, was working with 804

    Hi,
    Explain Plan (F6) was working cprrectly with Raptor 804 and is not working any more on 919. This is the same query exactly (select * from mytable). The server is 9.2.0.5.0. The result with 919 is "Invalid Column Name".
    Regards
    Eric

    I get this too.
    The plan table structure is
    CREATE TABLE "ELX"."PLAN_TABLE"
       (     "STATEMENT_ID" VARCHAR2(30),
         "TIMESTAMP" DATE,
         "REMARKS" VARCHAR2(80),
         "OPERATION" VARCHAR2(30),
         "OPTIONS" VARCHAR2(30),
         "OBJECT_NODE" VARCHAR2(128),
         "OBJECT_OWNER" VARCHAR2(30),
         "OBJECT_NAME" VARCHAR2(30),
         "OBJECT_INSTANCE" NUMBER,
         "OBJECT_TYPE" VARCHAR2(30),
         "OPTIMIZER" VARCHAR2(255),
         "SEARCH_COLUMNS" NUMBER,
         "ID" NUMBER,
         "PARENT_ID" NUMBER,
         "POSITION" NUMBER,
         "COST" NUMBER,
         "CARDINALITY" NUMBER,
         "BYTES" NUMBER,
         "OTHER_TAG" VARCHAR2(255),
         "PARTITION_START" VARCHAR2(255),
         "PARTITION_STOP" VARCHAR2(255),
         "PARTITION_ID" NUMBER,
         "OTHER" LONG,
         "DISTRIBUTION" VARCHAR2(30)And raptor seems to be issuing this
    PARSING IN CURSOR #2 len=82 dep=0 uid=80 oct=50 lid=80 tim=3808125826 hv=1796199517 ad='17ebc98c'
    EXPLAIN PLAN SET STATEMENT_ID ='4363' INTO PLAN_TABLE FOR select * from collection
    END OF STMT
    PARSE #2:c=0,e=742,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=4,tim=3808125815
    BINDS #2:
    =====================
    PARSE ERROR #3:len=480 dep=1 uid=80 oct=2 lid=80 tim=3808128369 err=904
    insert into "PLAN_TABLE" (statement_id, timestamp, operation, options,object_node, object_owner, object_name, object_instance, object_type,search_columns, id, parent_id, position, other,optimizer, cost, cardinality, bytes, other_tag, partition_start, partition_stop, partition_id, distribution, cpu_cost, io_cost, temp_space, access_predicates, filter_predicates ) values(:1,SYSDATE,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14,:15,:16,:17,:18,:19,:20,:21,:22,:23,:24,:25,:26,:27)
    =====================cpu_cost, io_cost, temp_space, access_predicates, filter_predicates seem to be invalid
    Message was edited by:
    smitjb

  • The icon for firefox is not working. "There was a problem sending the command to the program" pops up. Cannot get in to firefox

    Since the upgrade, the icon does not work. Now this message comes up. I made Google my home page by following directions on this site. I deleted the old icon as it didnt work, and this new one came up on my desktop and it presented the message above.

    Hi,
    Before you open any of the applications, please go to Task Manager to see if their processes are stuck there. If so, shut them down and try again.
    You can also try starting the applications in Safe Mode to determine if the problem is 3rd-party add-ins related.
    Please refer to this article below to learn more:
    http://office.microsoft.com/en-001/support/why-cant-i-start-my-office-2013-application-HA104011864.aspx
    As for the Excel problem 'There was a problem sending the command to the program', please note when double-clicking an Excel workbook, a
    dynamic data exchange (DDE) message is sent to Excel, instructing it to open the workbook that you double-clicked. If you
    turn on the "Ignore other applications that use Dynamic Data Exchange (DDE)“ setting,
     the DDE message sent to Excel by Windows Explorer is ignored, and Excel does not open the workbook that you double-clicked.
    To automatically solve this issue , we recommend to run “Microsoft Fix it 20074” and follow the steps in the wizard:
    http://support.microsoft.com/kb/211494/en-us
    You can also try to fix it manually by the steps under 'Let me fix it myself'.
    If the steps above don't help, we can try to repair Office from Control Panel -> Programs and Features to check the result.
    Regards,
    Melon Chen
    TechNet Community Support

  • On switching on today my emils did not work and I was advised to contact my service provider

    On starting up today my incoming emails were not displayed and I was advised to contact my service provider.After some time I clicked on the get mail tag and it worked and I have now received my emails.
    Comments?

    Follow this feed, I'm keeping it updated with what we know.
    https://discussions.apple.com/message/19592911#19592911

Maybe you are looking for

  • Can't find home drive after reinstallation of O.S.X

    Dear friends, I have one ibook G4 and a Macbook Pro. Two days ago, the ibook G4 failed to start up, I tried in safe mode then pass through. Then I run Onyx-automation followed by restart, after that neither my desktop nor the sidebar of the finder wi

  • MDM Sender Adapter issue in SAP PI7.1

    Hi All, How to schedule(there is no poll interval in Sender communication channel) MDM PI sender Adapter. Everytime we need to start and stop the channel then only file is being picked up. I checked port details, file is not picking up automatically

  • Wireless Guest Access with 802.1X (PEAP/MSCHAPv2) and ISE?

    Hi, I have a setup based on WLC 5508, Catalyst 3750-X and AP3600i. The WLCs are running 7.3 and ISE is 1.1.1 I'm trying to setup wireless guest access, where the guests connect to a SSID with 802.1X using PEAP/MSCHAPv2. They should receive their user

  • SAP E-Commerce 7.0 and Guest Checkout

    Hi, I searched through the forums here on the sdn and also through teh web in general looking for information on implementing Guest Checkout functionality for SAP E-Commerce 7.0. We are looking at adding in Guest Checkout functionality and before we

  • Interactive slideshow

    I often use my iPod for slideshows with background music. However does anyone know of a way in which I can use the iPod for a slideshow which has a commentary to accompany each slide? After the commentary has finished the slide should stay on screen