Separate string like "x,y" to x and y. how ?

Hi !
How can I seperate string like x,y to x and y ???
Thank you!

Hi,
if there is only one "," in that string, you can do it this way to
String yourString = "first part,second part";
int i =yourString.indexOf(",");
String first = yourString.subString(0,i);
String second = yourString.subString(++i);with a StringTokenizer do it this way:
String yourString = "first part,second part";
StringTokenizer st = new StringTokenizer(yourString,",");
String first = st.nextToken();
String second = st.nextToken();You see, if you have to separate more parts separated by "," the StringTokenizer would be the better choice - but that can be done also by a recursive or iterative method, which uses the first code.
Hope this helps
greetings Marsian

Similar Messages

  • I have a macbook pro in which i use for church recordings. it has a built in mic so like one hole for headphones and mic. how do i get it to only pick up the sound from the external mic that is coming into the mixer to the laptop. it seems to pick up ever

    I have a macbook pro in which i use for church recordings. it has a built in mic so like one hole for headphones and mic. how do i get it to only pick up the sound from the external mic that is coming into the mixer to the laptop. it seems to pick up everything, like for example any little movement i make or even just asking the next person a question will get picked up by the internal mic. is there a way i can mute the internal mic so it can only pick the external mic and not every movement im making like chewing etc

    I have a macbook pro in which i use for church recordings. it has a built in mic so like one hole for headphones and mic. how do i get it to only pick up the sound from the external mic that is coming into the mixer to the laptop. it seems to pick up everything, like for example any little movement i make or even just asking the next person a question will get picked up by the internal mic. is there a way i can mute the internal mic so it can only pick the external mic and not every movement im making like chewing etc

  • Applescript: how to record and return how many times a number appears when using a random number generator

    I create one rng and repeat another rng that many times like so:
    set x to (random number from 0 to 250)
    repeat x times
      set rn to (random number from 1 to 10)
    end repeat
    now what i would like to do is record and return how many times 'rn' comes up with one particular number. Any ideas?

    You could set up a list and increment the contents of a particular index each time it comes up, for example:
    set how_many to {0, 0, 0, 0, 0, 0, 0, 0, 0, 0} -- 1 thru 10
    set x to (random number from 0 to 250)
    repeat x times
      set rn to (random number from 1 to 10)
      set item rn of how_many to (item rn of how_many) + 1
    end repeat
    return how_many

  • Mac Book Pro with a separate apple keyboard (wired) randomly the keyboard will make a thudding noise like a key is depressed and then freezes

    Hi I'm using a Mac Book Pro with a separate apple keyboard (wired).  Randomly the keyboard will make a thudding noise like a key is depressed and stuck (which it isn't) which then stops when the keyboard is unplugged.  I've tried rebooting, plugging it into another port and unplugging  my mouse from it and it hasn't solved the issue.  I also can't pin point when it does it, it seems to be random so sometimes, like now it's fine and then others it does it every few minutes.  I'm reluctant to throw the keyboard out if there is a chance it can be fixed.  Any ideas?

    You cannot use any additional devices on the keyboard's USB ports when used in this fashion (except perhaps ONE low power Apple mouse). Anything more draws too much power and may make the keyboard malfunction. In general, keyboards do not tend to complain about low power, they just stop working properly.

  • I have a modem and a separate router in a part of my house that gets poor reception from the modem.My iPad won't connect to the auxillary router like my laptop does with ease. How do I get the iPad to connect?

    I have a modem, and a separate (hard wired from modem) router in a part of my house that gets poor reception from the modem.My iPad won't connect to the auxillary router like my laptop does with ease. How do I get the iPad to connect? It does see the router in my wi-fi connections list - just won't connect. !

    This article will provide a troubleshooting framework.
    http://support.apple.com/kb/TS1398

  • Skydiver. After using separate apple ID's our two iPad minis still get things mixed up like Siri changes our names and some phone

    Skydiver. After using separate apple ID's our two iPad minis still get things mixed up like Siri changes our names and some phone#'s

    but I would like to be able to dowload content to the Ipad as well.
    I'm afraid that you can't sync content to an iOS device via Home Sharing (you can only stream it to an iOS device via Home Sharing).

  • So, I have just about had it. For nine days now,  I have valiantly tried to move my library to an external drive. At first, I attempted to move it to my 2TB Time capsule, iTunes didn't like its new home though and moved home without telling me.

    So, I have just about had it. For nine days now,  I have valiantly tried to move my library to an external drive. At first, I attempted to move it to my 2TB Time capsule. iTunes didn't like its new home though and moved home without telling me. So then there were two libraries. I meshed them back together reluctantly and iTunes in a silent revolt, absolutely refused to use its own 'Keep Library Organized' criteria and may as well have thrown my music against the wall. Seriously, my 5 year old nephew has his computer files better managed. Then I bought a 3TB Time Capsule and you may ask yourself why??? Well, iTunes doubled in size- although when I ran apps that are designed to find duplicate iTunes files, it deleted the music I actually bought from iTunes. So then I watched as iTunes got it back. How you ask; I run a MacBook Air, iMac and Mac mini in my house - as soon as one powered up it hit the net like a sailor on leave and re-downloaded it all without abandon. I tried to keep the libraries separate, no success there. I tried to keep them unified; iTunes response was to ask me if I wanted to join iTunes Match every time I logged on to my computer and on any computer - my iTunes match song number has been as high as 24,367 and as low as 11,112. And I can't simply refuse iTunes. No one refuses iTunes. Refusal to allow iTunes Match to run through all 24000 songs again was to revoke my rights to the songs that were once part of my library. If I took a long time to decide or was visibly impatient while iTunes did its little 3 hour scan it would arbitrarily decide that music I bought from iTunes was ineligible for iTunes Match. How could that possibly be??? I am missing music, or at least iTunes tells me so by showing me that lovely exclamation point. I have tried backing up my computer to do a full system restore and start all over. Time Capsule claims I have 979 GB of data and takes its sweet time to even back up one gig (about 18 minutes) even though I can transfer files to my Time Capsule at about 1 GB every 40 seconds. I guess though performing back-ups are somewhat like government jobs; it will get done, when it gets done. The back up requirement of 979 GB is surprising though, my Mac claims that I currently occupy just about 25% of my 2TB drive. The discrepancy, who knows, but I think the solution lies somewhere in iTunes. But maybe iPhoto. But that is for another time.

    After admittedly only a quick read the one thing you don't say is how you are trying to make this move.  Most people with moving library issues do it the wrong way.  Plenty of web sites tell you how to do it the wrong way.
    If the iTunes application is started before the drive with the library is fully mounted and awake iTunes will revert back to the internal drive.

  • HT1349 How do I set up a separate icloud account? Both my wife and I have an iPhone 4s and an iPad, but only one Mac. We are tired of our "stuff" getting mixed up together when we sync.

    How do I set up a separate icloud account? Both my wife and I have an iPhone 4s and an iPad (1 and 3), but only one Mac. We are tired of our "stuff" getting mixed up together when we sync. Thanks much

    You don't need separate iCloud accounts if you want to simply sync unique content to each device using iTunes. I have three iDevices using one ID and one iTunes library and each device has it's own content on it. You need to set up the sync configuration for each device. This is what I recommend.
    First turn off auto sync in iTunes. Launch iTunes on the Mac and go to iTunes>Preferences>Devices>Prevent iPods, iPhones and iPads from automatically syncing. Click OK and then quit iTunes.
    Connect one of your devices to the Mac and launch iTunes.
    Click on the device name on the left side under the devices heading.
    Click on a tab in iTunes - Apps for instance.
    Click on the Apps that you want to sync to that device.
    Make sure that the Sync Apps heading is checked.
    Follow the same procedure for all of the other tabs in iTunes ..... Music, Photos, Movies and so on.
    After you have finished making all of your selections, click on Apply in the lower right corner of iTunes.
    When you are done, eject the first device and do the same thing with the other device. iTunes will now remember the sync configuration on each device.
    You can change that configuration any time that you like by following the steps outlined above.
    If you want to continue to auto sync, turn it back on in the iTunes preferences as described above.

  • How can I search for a string like a partial IP address in the global search

    When searching for a string like "10.255." the global search finds messages containing "255" or "10" and both.
    This happens no matter whether quotation is used or not.
    When quotation is used it probably will match on the given order as well, but beeing in the timezone '+0100' the string "10" is always found first (in the email headers...).
    Is there a way to tell the global search not to use '.' or any other character as whitespace?

    When searching for a string like "10.255." the global search finds messages containing "255" or "10" and both.
    This happens no matter whether quotation is used or not.
    When quotation is used it probably will match on the given order as well, but beeing in the timezone '+0100' the string "10" is always found first (in the email headers...).
    Is there a way to tell the global search not to use '.' or any other character as whitespace?

  • How do I take a date string, add "X" days to it, and display a new date?

    I have a date listed in a text string. I would like to convert it to a time stamp, and take a variable number of days, converted to seconds, added to the date, and displayed as a correct date. Example: 9/1/2011 adding 35 days is 10/6/2011. The trick seems to be getting it correct for every month and year combination. How can I accomplish this? I was thinking along the lines of time stamps, but any method that works consistently would be fine.
    Thank you!
    Solved!
    Go to Solution.

    You are right, use timestamps, they will take care of the working out the correct date for you.
    Interpret your string as a timestamp.
    Add your offset (use a numeric add, and consider using units on your variable)
    Reinterpret your datestamp as a string.
    Thoric (CLA, CLED, CTD and LabVIEW Champion)

  • What and for how long additional OR separate benefits I receive after buying Apple Care?

    I bought a MBA 13" in India (home) last month.
    I wanted to know about Apple Care / Extended warranty that is available for sth like ~15K (INR).
    Can you please give me a detail as in what do I get with this for my Mac and for how long?
    Can I buy this before the day my current/default warranty expires or shall I have to buy this within some stipulated period from the day of purchase of my Mac?
    What is already available for my Mac as of now and for how long? Shall anything be added to warranty or care that is available with my Mac as of now? Shall be added right from the day I buy it or it will happen so after my current warranty/care gets used up i.e. after completion or 1 year or for whatever period MBAs comes with care/warranty. So, these extended warranty simply increases the number of years on my protection plan or gives additional cookies?
    If I buy an iPhone5 then shall I have to purchase separate apple care for that? Or is it available for all my Apple products? Or if not then are there such plans that I can buy to cover all or many of my apple products and are cheaper as a combined purchase?
    Within that period if let's say my Keypad fails screen goes kaput then Apple will either fix it/replace it or it will ask for extra money if it needs replacement? Or will ask for extra money even if it was not accidental damage (my fault)? I read sth about accidental damage with AppleCare purchase - it adds to the first year also or only during the next two years (or next 3 years - not sure how long it holds).
    Shall I have to buy it offline or i can buy it online too? What if I buy from another country (online/offline) if it's available for cheap over there?
    I see some deals on such packages on eBay - mostly on USA eBay, and have read posts people buying it but they were mostly from USA/EU. Can I buy one of those? Shall they be valid for my product(s)?
    By the way, does Apple provide an email support with those plans because I couldn't find one email address for Apple support.

    http://www.apple.com/support/products/faqs.html

  • I want to spit cell the value into two separate columns like f_name & l_nam

    Hi Guys,
    I have excel data in one cell with ',' separated data.
    sample data:
    empno ename
    121 ravi,kann
    232 ram,raman
    here ename value in one provided in one cell.
    Now i want to spit cell the value into two separate columns like first_name and last_name?
    Thanks in advance
    -LK

    with sample_data as
      select 121 empno, 'ravi,kann' ename from dual union all
      select 232 empno, 'ram,raman' from dual
    select empno,
           substr(ename,1,instr(ename,',')-1) first_name,
           substr(ename,instr(ename,',')+1) last_name
    from sample_data;       or with regular expressions:
    with sample_data as
      select 121 empno, 'ravi,kann' ename from dual union all
      select 232 empno, 'ram,raman' from dual
    select empno,
           regexp_substr(ename,'^[^,]*') first_name,
           regexp_substr(ename,'[^,]*$') last_name
    from sample_data; Edited by: hm on 04.07.2012 06:22

  • Compile source string like java code

    I need to calculate some user defined formulas in my application. I have this formula in string form (e.g. "operand1 * operand2 + operand3" ). I have gained operand values throught the reflection and pars this string throught the StringTokenizer. So I have parsed string with operand values and operators. Is it possible to compile this string like java code ?
    Thanks for all hints

    Compile to what - a class file?
    Yes, it's possible if you don't mind using non-100% pure Java. You can compile them using the sun.tools.javac.Main class found from tools.jar in the lib directory of the jdk.
    But from what you say it would be easier to use an existing expression evaluator. Take a look at JEP (jep.sourceforge.net) and BeanShell (www.google.com) before you make any decision.

  • I have an iPhone5. I update to iOS7. Now I cannot edit my messages. I have to delete the whole message string like in iPhone 1. What has gone wrong

    I have an iPhone5. I updated to iOS7. Now I cannot edit my messages. I have to delete the whole message string like in iPhone 1. What has gone wrong?

    Thanks it resloved my question, but Apple has made it more complicated it was so much easier to just press the edit button and select messages to be deleted. Now its cumbersome to delete several messages. Apple should give us back the edit button.

  • Need multiple 'MAIL' Icons.   Have two mail accounts and i want to keep them separate but want to EASILY switch back and forth from the main screen instead of going through, Settings, Mail, and selecting account. Major pain

    Have two mail accounts and i want to keep them separate but want to EASILY switch back and forth from the main screen instead of going through, Settings, Mail, and selecting account. Major pain the butt.  This has been a request from Apple users for many years.    it's great you can now combine all emails into one, but some people want them kept separate and have separate icons on the main page.   They could easily do this by having one "MAIL" account as white and another red.  Or put MAIL 1 and MAIL 2.    Or an actual label that the mail accounts are called on the ICONS!!  
    Help!

    eshghoolak wrote:
    ...I could switch back and forth between accounts while in the mailbox, with one button.  I think that is what you are referring to?  Whoever said it's just a simple switching - you obviously haven't had the pleasure of using an Android device.  It's not that quick to go back and forth - definitely not efficient...
    Not that it matters a lot, Android vs iPhone interface is largely a matter of personal preference and what you know... I'm not sure which one you're saying is not efficient...
    In any event...
    I currently have two email accounts setup.  My iPhone main page Mailbox settings reads:
    Mailboxes
    Inboxes
    All Inboxes
    Gmail
    [email protected]
    Accounts
    Gmail
    [email protected]
    I wish there an efficient way to move back and forth while in the "Inbox" between accounts.  Also, Why does one gmail account show as "Gmail" and another as the actually address?
    The names are based on the names you gave the accounts when you set them up.
    Settings>Mail, Contacts, Calendars.
    Tap the account you want to re-name. Go to the "Description" field and put in what ever you want.
    Second, there is no way to quickly choose a bunch of emails to delete. I have to manually go into each one and move it to the Trash folder.
    If you tap the edit button in the upper right while in mail, you can select multiple items to move, delete or mark (flag).
    I don't want any of the condescending remarks, that I've read here and in other forums.  I'm honestly looking for a solution, which I think you are too!  One thing I realized is that iPhone users in these forums are really defensive and quick to say "that's how it is, live with it, if you don't like it go away"  Um...the only thing that tells me is you are pretty bitter and have kept telling yourself that, to force yourself to like your device.  I prefer to express my issues, and find solutions.  There is ALWAYS a solution...
    I think what you will find is that many people here, myself included, tend to get a bit short with people who start off with attacks or whining about how something has been asked for for years and should be easy, rant about things that have already been beaten to death multiple times in the forums, talk about how much better Android or BB are at something (really... if it's that much better, why did they buy an iPhone to begin with?), etc., or continue to ask questions that could easily be answered with a simple search, or even just by looking back at the last dozen posts to the forum, half of which probably asked the EXACT SAME question.
    I don't think any of us go out of our way to be rude or uncivil.  That said, attacking the people who are attempting to help you is much more likely to generate a response of 'if you don't like it, go away', than it is to generate something that will be truly helpful.

Maybe you are looking for

  • F110 form issue.

    Hi Experts , Iam calling F110 and it internally calls F110_PRENUM_CHCK and actually what happens it isprinting the check details and all the information in the 1st page. But in the 2nd page it is printing. User: XXXXXX Host: XXXXXX Class:XXXXXX Job:

  • Flat-file Reconciliaiton

    I have used the following link to perform a flat-file reconciliation. I assumed this sample would handle adds, updates and deletions. However, that does not seem to be the case. If I modify or delete an existing record from the file and then re-run t

  • How to deploy content of webdynpro- src- mimes via JDI ?

    Hello, maybe anyone has overcome this problem already. I am developing a webdynpro application using JDI scenario 2+ (dev in track). The application has a xml ini file and some pictures in the src->mimes->Components folder. When I build and deploy th

  • Itunes: where has the english lanquage gone?

    Can you assist, I have downloaded Itunes 11 many times hoping to correct the following problem. There is no english choices in the lanquage list and by default it uses the first listed  lanquage which I can not read nor any of the others.

  • Buying external hardrive for Mac OS X 10.5.8

    I am looking to buy an external hardrive but I can't find any that are compatible with my version of the mac. What external hardrives are compatible with Mac OS X 10.5.8?