Can we use StringTokenizer using 2 things???

i have a sentence with several brakets and i want to tokenize it using two sign the) and , i.e
my sentence is
today(lana(went([to,preposiotn,the,det,park,noun]))),john(went(to,preposiotn,the,det,school,noun]))),
what i want to do is to divide the sentece when there is ), TO BE
today(lana(went([to,preposiotn,the,det,park,noun]))),
john(went(to,preposiotn,the,det,school,noun]))),
So i thought of doing
StringTokenizer tokens=new StringTokenizer(stringToTokenize,",");
but it just take the )
any ideas????

If you want to leave the comma in place:   String[] parts = str.split("(?<=\\),)"); Or you can drop the comma:   String[] parts = str.split("(?<=\\)),"); StringTokenizer treats the "delim" argument as a set of single-character delimiters, and it doesn't recognize empty tokens. That means, if you use ")," as the "delim" argument, it will treat any sequence of one or more close-parens or commas or both as one delimiter. StringTokenizer is one of the most counter-intuitive classes I know of. Of course, split() isn't exactly a no-brainer either, but it can handle many problems that, like this one, are impossible to solve with a StringTokenizer.

Similar Messages

  • How do i get just a movie to play on apple tv but so i can still use other things on macbook

    i want to play a movie from netflix that is on my macbook on my apple tv but i still want to be able to do other things on my macbook. Is there anyway i could play the movie and still use my macbook for other things?

    Welcome to the Apple Community.
    It does not give me the ability for multiple speakers like it does on my computer.
    Sorry, but it isn't supposed to do.

  • Can I use iPhone without a computer?

    So I have a mac with 10.3.9 which doesn't support iphone (10.4.x onwards only i believe) - If I get an iphone can I use the phone function, wi-fi for mail and internet etc without connecting it to a computer at all? I DL'd the manual and it tells you as one of the first steps to connect to your computer via USB and register it. Is this essential? To use the phone in any way at all do you have to register it?
    I'm happy to go to a friend's house with a compatible mac eventually and load some mp3s and videos or whatever on to it but would like to know if I can just use the thing as a phone first without needing a computer at all.

    Oh man.
    Yes I own a powerbook. My reasons for not being able to use it are... I use Avid editing software on it. If I upgrade to the latest version of OS X, or even an earlier one like 10.4.x then I will have to upgrade my Avid - that costs money that I don't have. It works well on my 10.3.9 and I've been happy with this. Until now it seems.
    In order for you guys to be helpful to me here we'll all have to pretend that we aren't proud nerds that secretly wish we could control our cars from our phones (this includes me so don't be offended).
    Pretend for a second that the iPhone isn't the best thing since sliced bread and can do almost anything and pretend that some people might be happy setting it up and just using it without updating it's software all the time and just treating it like they've treated all their other phones - as a phone.
    You all have answered me like I should know better than to suggest I might try to keep my iPhone use simple. I bet Apple themselves aren't comfortable with anyone suggesting that the iPhone needs to suckle at the teat of a computer every day just to keep working! If that really was the case then surely this phone would unusable for any extended trips away from home - going on holiday for a week to Brazil would be out because your iPhone can't survive without being synced! Come on!
    All I want is to set it up and use it unaided. Is this possible in the first instance, straight out of the box with no computer.

  • I have an ipod touch but i don't have enough memory and 0I get an upgrade soon for my phone and i want the iphone but the thing is, can i have an ipod touch and an iphone on the same itunes account like can i use my money on my ipod account for my iphone

    I have an ipod touch but i don't have enough memory and 0I get an upgrade soon for my phone and i want the iphone but the thing is, can i have an ipod touch and an iphone on the same itunes account like can i use my money on my ipod account for my iphone

    Your iPhone and iPod can share the same iTunes account.  Apps can be freely shared and used by one or both devices.  You can't use money in your iTunes account to pay for your phone, but purchased apps can be used by both the iPod and iPhone.

  • Can I use my iPad (1st gen) with apple tv (2nd gen) for things such as air play and mirroring?

    Can I use my iPad 1st generation on a apple tv 2 generation for things such as AirPlay and mirroring
    I'm thinking about getting a new apple tv but it's pointless if iPad doesn't mirror or AirPlay, cheers guys.
    I understand the 2nd generation works.

    No. There are some apps that allow you to control the laptop remotely from an iPad, however, but that doesn't sound like what you need.

  • I can't use my applications as I have a 'download error' and told to try again, but same thing happens ... any ideas?

    I can't use my applications as I have a 'download error' and told to try again, but same thing happens ... any ideas?

    Hi There,
    Kindly try the below mentioned link:
    Re: Creative Cloud - Download error - stubborn error
    Creative Cloud "Download Error" message
    Error downloading and installing Creative Cloud application
    Thanks,
    Atul Saini

  • Can I let my daughter use the things in my itune account in hers?

    I just bought my daughter an ipod touch and I want to load it with some of the things that I have purchased from itunes for my iphone. She has a separate itunes account with her old ipod. Is there a way to let her use the things from my itunes library? I don't want to have to buy things twice if I don't have to. Any help would be appreciated!!!

    My sister just got an iPod but we restored it. Now she has no music but every time i plug her ipod into our computer my itunes pulls up an it tries to upload the music into her ipod! there is songs that i have that she doesn't want! but if i delete them from itunes it will delete from my ipod when i plug it into the computer when i go to charge it the next time! i tried to download another itunes to our computer but it just upgraded my old itunes!! i can use any advice! please an thank you!! i really appreciate it!!

  • I find it rather frustrating that you can't use things like {myArray[0]} in Bindable expressions

    I find it rather frustrating that you can't use things like
    {myArray[0]} in Bindable expressions. Are there any workarounds
    apart from manually changing the dataprovider?

    Yes, instead of an array you have to use an arraycollection
    (just wrap your array) and then you can use this with the
    getItemAt()-method.
    e.g.
    {myArrayCollection.getItemAt(0)}
    cheers
    Dietmar

  • Lost my iphone ios 7.2.0 with a pass code an iCloud activate the thing is who ever finds my phone puts it on DFU mode and restore it I'm aware he can do that but can't use it without my iCloud will I be able to track the phone if connected to wifi

    Lost my phone it had ios 7.2.0 with pass code and I cloud  I'm aware it can be restore on DFU mode but can't use it if they don't have the iCloud user if and password the phones linked with. Question is in this process if the person connects it to his or her wifi to setup up the phone will I be able to track the phone after the restore ? Even though he can't use it because he has no Id no password

    You can do nothing if it's not online. With a passcode and iOS 7.1 (there is no 7.2) the device is uselss because it cannot be erased except by you.
    What To Do If Your iDevice or Computer Is Lost Or Stolen
    iPhone, iPod Touch, and iPad
    If you activated Find My Phone before it was lost or stolen, you can track it only if it is connected to the Internet by Wi-Fi or cellular. What you cannot do is track your device using a serial number or other identifying number. You cannot expect Apple or anyone else to find your device for you. You cannot recover your loss unless you insure your device for such loss. It is not covered by your warranty.
    If your iPhone, iPod, iPod Touch, or iPad is lost or stolen what do you do? There are things you should have done in advance - before you lost it or it was stolen - and some things to do after the fact. Here are some suggestions:
    This link, Re: Help! I misplaced / lost my iPhone 5 today morning in delta Chelsea hotel downtown an I am not able to track it. Please help!, has some good advice regarding your options when your iDevice is lost or stolen.
      1. Reporting a lost or stolen Apple product
      2. Find my lost iPod Touch
      3. AT&T. Sprint, and Verizon can block stolen phones/tablets
      4. What-To-Do-When-Iphone-Is-Stolen
      5. iCloud- Use Lost Mode
      6. What to do if your iOS device is lost or stolen
      7. 6 Ways to Track and Recover Your Lost/Stolen iPhone
      8. Find My iPhone
      9. Report Stolen iPad | Stolen Lost Found Online
    It pays to be proactive by following the advice on using Find My Phone before you lose your device:
      1. Find My iPhone
      2. Setup your iDevice on iCloud
      3. OS X Lion/Mountain Lion- About Find My Mac
      4. How To Set Up Free Find Your iPhone (Even on Unsupported Devices)
    Mac Computer
           Find My Mac can be used from Find My Phone at iCloud.com and via Find
           My Phone on your iDevice.
          The following is third-party anti-theft software:
               1.  STEM 2.1
               2.  MacPhoneHome 3.5
               3.  MacTrack 7.5.0
               4.  VUWER 1.7
               5.  Sneaky Bastar* 0.2.0
               6.  Undercover 5.1.1
               7.  LoJack for Laptops
               8. Hidden 2.0
               9. Prey 0.6.2

  • I'm deaf in one ear and need a stereo-to-mono earbud so I can use my iPod and iPhone. It is not good being able to hear only one channel. Can Apple consider making such a thing for those of use who need such a thing?

    I'm deaf in one ear and need a stereo-to-mono earbud so I can use my iPod and iPhone. It is not good being able to hear only one channel. Can Apple consider making such a thing for those of use who need such a thing?

    bassvid wrote:
    Thanks...now I need to do something about the iPod.
    I'm not sure which version iPod you have, but I just checked my iPod nano (current generation) and it also has a Mono Audio setting in Settings>General>Accessibility.

  • Hello i have a problem that i was making update IOS7 for my i phone 5 it's taking a lot of time about 4 hours till now, i can't use my phone know, it's appere logo i tunes only, can't do eny thing else like shutdown

    Hello i have a problem that i was making update IOS7 for my i phone 5 it's taking a lot of time about 4 hours till now, i can't use my phone know, it's appere logo i tunes only, can't do eny thing else like shutdown

    Hey Andrew keriakous,
    Thanks for the question. It sounds like your iPhone may be in recovery-mode. To resolve this issue, see the following:
    If you can't update or restore your iOS device
    http://support.apple.com/kb/HT1808
    Thanks,
    Matt M.

  • I can't use credit cards to buy things in the game

    I can't use credit cards to buy things in the game

    OK.
    Do you have a question?
    If so, then explain your issue in greater detail, then ask it.

  • Can i use an itunes gift card to buy things from the games im playing?

    can i use an itunes gift card to buy things from the games im playing?

    how do i do that? .. im playing clash of clans..

  • HT4061 I bought my mom an iPad for Christmas this year.  We can't use it as it will not recognize her passwords.  How do I reset it without using passwords.  I want this thing wiped clean, just like it came from the store so that I might start over.

    I bought my mom an iPad for Christmas this year.  We can't use it as it will not recognize her passwords.  How do I reset it without using passwords.  I want this thing wiped clean, just like it came from the store so that I might start over.  This is very frustrating!

    How can I unlock my iPad if I forgot the passcode?
    http://www.everymac.com/systems/apple/ipad/ipad-troubleshooting-repair-faq/ipad- how-to-unlock-open-forgot-code-passcode-password-login.html
    iOS: Device disabled after entering wrong passcode
    http://support.apple.com/kb/ht1212
    How can I unlock my iPad if I forgot the passcode?
    http://tinyurl.com/7ndy8tb
    How to Reset a Forgotten Password for an iOS Device
    http://www.wikihow.com/Reset-a-Forgotten-Password-for-an-iOS-Device
    Using iPhone/iPad Recovery Mode
    http://ipod.about.com/od/iphonetroubleshooting/a/Iphone-Recovery-Mode.htm
    You may have to do this several times.
     Cheers, Tom

  • I turned on this thing called "VoiceOver" on settings accessibility and now I can't turn it off! PLEASEEE HELPPPPPP I CAN'T USE MY PHONE WELL! besides, I can't scroll down either.

    I turned on this thing called "VoiceOver" on settings>accessibility and now I can't turn it off! PLEASEEE HELPPPPPP I CAN'T USE MY PHONE WELL! besides, I can't scroll down either.         

    DONEEE! I ALREADY FIXED IT! thanks

  • I have a Ipad4  and now it shows a big screem and I can't use it any more. I did a lot of things like full restore and the Ipad keeps not work well. What can I do? Is it a hardware problem?

    I have an Ipad4  and now it shows a big sceem  and I can't use it any more. I did a lot of things like full restore and the Ipad keeps not work well. What can I do?          Is it a hardware problem?
    Look the 2 images on link below:
    https://www.dropbox.com/sh/0arufrxzjwwmweu/6Fxz1Ljbmd

    Try Settings > General > Accessibility > Zoom: OFF
    Note: You may need to use 3 fingers to tap and scroll.

Maybe you are looking for

  • WAN light not working!

    My Network extender just currently stopped working out of the blue. My WAN light is not coming on at all, my ethernet cable is plugged in correctly. I even switched out the cable just in case the cable went bad. I have reset the system and still no W

  • Issue with printing program Z_RVADIN01

    Hello Experts, I am facing a funny issue and ask your help/ opinion on this: I created a new window/ element "payer" within the form for billing-docs (output type RD00). In this new window "payer"  the address of an alternative payer should be shown.

  • Problems printing a digitally signed PDF

    Hi I'm having problems printing a digitally signed PDF on a dell 968 AIO printer. It works fine on the a majority of printers but we have had reports of issues with other models as well as the dell printer. The PDF prints fine when opened in Adobe Re

  • I have the BOR object  selfitem not delegated to any subtype

    i use the above one in a task if i create a new subtype,delegate it to this and use it an another task does it effect the first one.

  • Reg. Reporting Agent

    hi Will anyone explain about Reporting Agent and BW Crystal Reports. Thanks regards Sridhar [email protected]