Best way to look for next char in String that is NOT "-" or " " or ","?

I have a long String that is sent to me and needs to be parsed. Normally I can figure the end of the line by a line break, but sometimes the line break is lost only after the second line. This second line contains the characters:
These characters can all appear any number of times. I will know I'm at the end of the line when I hit a character that is not one of those three. What is the best way to look for this? Is there an already set method in the Java API?
Thanks for all the help!

There are solutions using regular expression, eg; you can split string once a time using minus char, whitespace or comma:
String tokens[] = anyString.split("\\-|\\x20|,");
More sophisticated expressions could be done to achieve results:
String re = "^(.+)(\\-|\\x20|,)(.)(.*)$";
Matcher m = Pattern.compile(re).matcher(anyString);
if (m.matches()) {
String
before = m.group(1),
delimiter = m.group(2),
firstCharAfterDelimiter = m.group(3),
suffix = m.group(4);
Regards.

Similar Messages

  • Best Way to Check for same Word in string?

    If I have an array of words, would the best way to check for the same word be to use 2 for loops?

    Huh?
    Sounds like homework...
    What is a word? Presumably a String.
    For equality of Strings you use...
        String s1 = ....
        String s2 =....
        if (s1 == s2) { equal depending on null case
        else if ((s1 != null) && (s1.equals(s2))) { equal }
    For the case of checking one array to another....
          while items in array1
                 get itema from array1
                      while items in array2
                           get itemb array2
                                  is itemb equal (see above) to itema
                                         yes - then do something

  • Best way to look for missing sequencial numbers in infocube?

    I'm looking for some ideas on the best way to do the following:
    The characteristic transaction number is in a cube by day, store, and register.  I need to ensure there isn't a missing transaction number across days...
    Example:
    5/16        Store:  5     Register: 1       Txn:  12345
    5/16        Store:  5     Register: 1       Txn:  12346
    5/17        Store:  5     Register: 1       Txn:  12348
    (So in the example above txn 12347 is missing.)
    We are talking about 300,000 transactions per day
    First Idea:
    I was thinking about using an infopackage to extract the 2 days from the cube(600,000 records) and I could use ABAP in the start routine to figure out if there is a missing txn.  Would that work?  I vaguely remember something about a start routine only having access to a package, not the whole dataset.
    Second Idea:
    Is there a way to have a query get the last txn # from previous day and the first txn # from the current day?  Then I could use a workbook with VBA to figure out the missing txns.
    5/16        Store:  5     Register: 1       Txn:  12346
    5/17        Store:  5     Register: 1       Txn:  12348
    5/16        Store:  5     Register: 2       Txn:  67890
    5/17        Store:  5     Register: 2       Txn:  67891
    5/16        Store:  6     Register: 1       Txn:  45678
    5/17        Store:  6     Register: 1       Txn:  45679
    (This would be 1500 records since we have 150 stores, 5 registers each, for 2 days.  150 * 5 * 2)
    Any other thoughts, ideas, or comments?
    Thanks,
    Chris

    Not sure if the following method is the most intelligent,  but worth a try if you have no better way...
    1) Create a query with required variables (like Register, Calendar Day etc) placed in the free characteristics and the Txn Number placed in the rows. If the Txn number is a characteristic, from the properties, choose SORT ASCENDING. Else you can use listcube t-code and sort the output in the ascending order, then save  the list as a local file (excel sheet) onto the desktop.
    2) Create a separate Excel file with the transaction numbers in ascending order (assuming that you know the txn number range for those days in the period of interest). This is very easy to do in Excel especially since they will be in order (type 1 txn and drag it downwards which will increase the number serially).
    3) Now that you have two files (first one is the as-is records and  the second one ideal records) compare these two files using a software like <a href="http://www.scootersoftware.com/beycomp_062808.exe">Beyond Compare</a>. I have used this software before and found it to be useful.
    Not sure if this helps, but good luck!

  • Where do i look for mail sent through thunderbird that does not get delivered

    I have two email clients. One is thunderbird and the other through my local server. I know some of my emails are not being received because of address changes.where do i find or set up undelivered mail notification in thunderbird . To address airmails answer;Thunderbird is being promoted as an open source stand alone email client if i'm not mistaken

    There is no such thing as a Thunderbird email account so not sure what you are talking about there. I am not even sure if you are talking about mail you have sent or mail you are expecting to receive.
    Thunderbird connects to your actual email providers server Inbox and downloads what is there. Maybe you should contact your email provider. You could check your providers Spam folder to see if mail is getting filtered there.

  • Custom IAC applications the best way to go for putting R/3 screens on web?

    Hi all,
    I am trying to figure out whether a Custom IAC would be a best way to go for putting custom developed R/3 transaction on the web. We want to put the R/3 transactions on the web but want to completely customize the look and feel of it. Is IAC the best way to go for it? will this work with any kind of transactions?
    cheer,
    i028982

    Hello,
    The ITS might not be the "best" way, but it sure would be an easy way.  If the transaction and screens are already created in the R/3 then you could just go to SE80 and create HTML templates to see if it will do what you want.  Steps:
    1. Transaction SE80
    2. Choose "Internet Service"
    3. Type in a custom developed z* name
    4. Right-click on the z* name and choose Create > Theme
    5. Create theme 99 (standard theme)
    6. Right-click on the z* name again and choose Create > Template
    7. Type in all information, theme number, program name and screen number.  Play with the "Generation Style" to see which one would better fit your transaction.
    After creating the screens you can publish to your ITS and give it a test.  Maybe this is all you need, if so, it would be fast and readily available.
    Best regards,
    Edgar Chuang

  • What is the best way to prepare for CERTIFICATION?

    what is the best way to prepare for CERTIFICATION?
    what is needed?
    where can i read more about it?

    Hi,
    Do as much as possible exercises based on your course material(which will be more than enough).
    If you know (some) Java and have understand the basics of OOP then this is enough for the exam.
    And do not forget:
    it is a multiple-choice test meaning that you see the possible answers.
    Either a single answer is correct (then you will have radio-buttons) or several answers are correct
    (then you will have checkboxes; in this case almost all questions will have more than one correct answer).
    You can refer to the topics for the certification
    https://websmp102.sap-ag.de/~sapidp/011000358700000499112003E
    Some links which might help
    /message/213564#213564 [original link is broken]
    /message/514469#514469 [original link is broken]
    /message/1315746#1315746 [original link is broken]
    /message/1736299#1736299 [original link is broken]
    /message/1736299#1736299 [original link is broken]
    /message/257122#257122 [original link is broken]
    /message/130164#130164 [original link is broken]
    /message/1916905#1916905 [original link is broken]
    /thread/167254 [original link is broken]
    /message/213564#213564 [original link is broken]
    /message/1315746#1315746 [original link is broken]
    <b>
    you try www.sapdoamin.com
    They provide Certification simulation questions which are veryuseful and a must try site.</b>
    Yes more questions comes on OOPS so get your OOPS concepts very clear.
    You don't need to do extensive coding in OOPS.
    Just get the concepts clear and i am sure the certification will be a cake walkthrough.
    All the best and good luck with your ABAP Accreditation.

  • New MBP - Best way to care for battery?

    Not sure if this is necessary anymore, but I am receiving my new MBP in the mail later today. What is the best way to care for the battery? Should I plug the MBP into the wall for an amount of time before turning it on, or at least wait until it is fully charged before turning it on for the first time? Is anything like that even necessary anymore?
    Thanks,
    Keith

    Here's what Apple recommends:
    http://www.apple.com/batteries/notebooks.html
    Best use is frequently and lightly. Be sure to calibrate your battery every two months or so:
    http://docs.info.apple.com/article.html?artnum=86284
    Hope this helps...

  • What would the best way to go for an virtual grid?

    I need a 3 x 8 virtual grid that I can change values to:
    Red
    Blue
    Spoiler
    what would the best way to go for this objective?
    Thanks!

    I need a 3 x 8 virtual grid that I can changevalues
    to:
    Red
    Blue
    Spoiler
    what would the best way to go for this objective?
    Thanks!Create a Grid and a Tile class. A
    Grid has a 2D array of Tile objects an
    a Tile has an attribute called Color and, say,
    an x- and y-point. Program some appropriate methods.
    Done.
    Thanks for trying, but Nanook already gave the correct answer in reply 1.Is it possible to restrict these? to like a 8 x 3 grid ?
    or should i use an if statement?

  • What is the best way to export for use on internet?

    what is the best way to export for use on internet?

    It depends. Is this for a personal web site or for a site like YouTube, Vimeo or Facebook?
    For YouTube, Vimeo and Facebook, use Publish & Share/Computer/AVCHD using one of the YouTube presets.

  • I need help figuring out the best way to convert analogue video to DV so that I can edit it.

    I have a large number of VHS and hi8 tapes that I want to convert to high quality DV.
    I have a couple of options. One is an Elgado Video capture system.
    The other is a Sony Digital Media Converter Box (DVMC-DA2).
    I have tried a few of the less important tapes using the Elgado Video Capture system. It only allows you to convert to MPEG4 or H.268. It is not very good quality, especially for archival items or items I would later wish to edit.
    I also have the Sony Digital Media Converter Box. I have heard that this is a superior option. So far, though, I have only been able to figure out how to import using an old version of iMovie HD. This makes a large imovie project file (approximately 6.18GB for a 28:30 clip vs a 348.9MB for an MPEG4 using delgado.
    On top of that to convert the file from an iMovieProject file to DV is an additional step that so far looks like will take a half an hour at best.
    Is there any way for me to import VHS/hi8 tapes using the Digital Media Converter Box to creat high quality DV files directly? If so, where can I find this info? What steps should I take and what are the settings I should use.
    I have a lot of tapes so I want to figure out the right and most efficient way to do this because I will be repeating it a bunch of times and would hate to have to start over again.
    I should also mention that I am using a Mid 2010 MacBook Pro, with OSX 10.9.1
    I'm sorry in advance if this seems like an obvious question, but I have been googling and looking at tutorials on the site and just have not found the answer. There are a lot of ads for expensive low quality services to do this converting for you, so maybe the answer I am looking for is burried in all that advertising.
    Thanks

    Thanks Biggles and Gotz. I just couldint find capture, but now I can! (It was right under my nose too).
    I'm trying it now and it appears to be working. Do you have any other recommendations for capturing from hi8 video source as far as setting go? I am using DV to capture. Are there any other settings I should pay attention to?
    There is an extra line of video noise at the bottom, but when I google it, it sounds like it won't show on most standard tvs and if I want to fix it for online, that I should mask it after the fact vs scaling up the video.

  • Looking for a drum loop app that will run in the background. What are you using?

    Looking for a drum loop app that will run in the background. Suggestions? What are you using? I tried Loopseque and I like it, but I can't make it run once I switch apps. Help please.

        That's definitely strange, kzmidge. I want a working phone in your hands though. I noticed you mentioned you received the suggestion to complete a reset. Did you already do that? Is it working again? Are you receiving an error message?
    If you hesitated a little longer to complete the reset, you can try to place your phone into Safe Mode http://vz.to/rxg0ii and see if you can access mobile sites from your browser. This mode will stop 3rd party applications from running, so you won't be able to use the apps you mentioned but we may be able to narrow down the trouble in Safe Mode. If the mobile sites work, that means the trouble may be in a recently downloaded application and you may be able to avoid the reset my uninstalling some of your more recently installed applications. If it's still giving you trouble, the reset http://vz.to/18wzOCi is the next best step.
    JenniferH_VZW
    Follow us on Twitter www.twitter.com/vzwsupport

  • Looking for an Appointmen​t Calendar that does THIS...

    I'm a stylist who owns a 700wx with Verizon. I am looking for an appointment calendar app that does ALL of the following?
    1. Books 15 minute appointments.
    2. Jumps weeks at a time (For example, a client wants to rebook for 6 weeks... I don't want to count the weeks, I want to tap them)
    3. Appointments can be booked with contact names. (For example, March 27th at 6pm... book this Contact... >?)
    4. Notepad or other type popup for notes (What services, what price, special situations...etc)
    Or does anyone know of any Salon Appointment software available for the 700wx?
    Post relates to: Treo 700wx (Verizon)

    Ok. I didn't see "Attendees" as being the same as Contacts.
    I don't want recurring appointments... although I will use it, just more rarely. I want it to jump weeks. (Some salon software has links that actually say "Jump 4 weeks" or 4 weeks, 6 weeks, 8 weeks" etc.
    Can it remember appointmnt TYPES? Like, meeting is always 15 minutes, or hilight is always an hour? Or will I always have to specify how long to block? I'm not sure if I'm explaining this correctly. Is there a way to set up preset appointment TYPES and their duration???
    Post relates to: Treo 700wx (Verizon)

  • I have 300 stores and I'm looking for a global QOS config that would shape/policy the bandwith based on a % of the detected ISP link speed

    Hi,
    We have 300 stores with mostly the same router config.
    The router in each store is a cisco 891 router capable of doing QOS.
    Each of our store is connected to internet through a local Internet Service Provider (ISP).  They all have different ISP.
    Each store has different Internet plan with different speed, some are DSL, other are using cable modem.
    The connection between the router and the modem is 100Mbps. But the real speed after the modem will be different depending of the Internet plan the store is using. Exemple : 20Mbps download / 2Mbps upload.
    I'm looking for a standard QOS config that would be put in each routeur and that would shape/policy the bandwith based on a % of the detected ISP link speed.  The goal here is to prevent a single desktop computer of the store to take all available bandwith of the ISP link because of youtube , cloud photo upload, etc.
    Because the wan of the router is in the modem at 100Mbps, I cannot use this bandwith indication for the % calculation. The ISP link speed (after the modem)  is much lower than that.  
    In other words, I dont want to set specific qos value or bandwith manual value in each of my 300 router. Especially because the ISP speed is not the same in each site, it's a big job and it's changing all the time.  Stores owner boost their link, etc.
    So, Is there a way within the router to detect the Wan real max speed and to assign dynamically % of the deduced value and assign it to different policy-map rules, etc.
    regards
    Jonathan D

    Disclaimer
    The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.
    Liability Disclaimer
    In no event shall Author be liable for any damages whatsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.
    Posting
    I'm unaware of any (one) "built-in" feature that will do what you're desire.  (BTW, I don't believe PfR, as mentioned by Matt, will do what you desire either, but I've haven't used it in several years.)
    I was looking to address a somewhat similar problem several months ago, and believe I could construct dynamic QoS shaping using an embedded device script working with IP SLA monitoring.  However, the "problem" site (using a cable modem) closed, so I didn't pursue it further.
    An alternative approach would be to use as few policy models as possible.  For example if there are sites with 2, 3 or even 5 Mbps uploads, you might use a 2 Mbps shaper for each.  Of course, sites with more available bandwidth won't obtain the full advantage of it, but your maintenance support will be easier.  Conversely, especially for cable modems, running under their nominal speed might provide much more predictable performance, as HFCs are generally much more variable in their actual available bandwidth, moment to moment.

  • HT4623 If i go to general and look for the software update button, there is not one on my ipad2. What do i do then?

    If i go to general and look for the software update button, there is not one on my ipad2. What do i do then?

    If you have an iPad 1, the max iOS is 5.1.1. For newer iPads, the current iOS is 6.0.1. For the iPad Mini the iOS is 6.0.2. The Settings>General>Software Update only appears if you have iOS 5.0 or higher currently installed.
    iOS 5: Updating your device to iOS 5 or Later
    http://support.apple.com/kb/HT4972
    How to install iOS 6
    http://www.macworld.com/article/2010061/hands-on-with-ios-6-installation.html
    iOS: How to update your iPhone, iPad, or iPod touch
    http://support.apple.com/kb/HT4623
    If you are currently running an iOS lower than 5.0, connect the iPad to the computer, open iTunes. Then select the iPad under the Devices heading on the left, click on the Summary tab and then click on Check for Update.
    Tip - If connected to your computer, you may need to disable your firewall and anitvirus software temporarily.  Then download and install the iOS update. Be sure and backup your iPad before the iOS update. After you update an iPad (except iPad 1) to iOS 6.x, the next update can be installed via wifi (i.e., not connected to your computer).
     Cheers, Tom

  • HT204266 looking for the old Netflix app that will work on original Ipad with ios 5.1.1

    looking for the old Netflix app that will work on original Ipad with ios 5.1.1

    Netflix does in fact have the old version of their app available.
    In iTunes on your computer, download the App you want a compatible version for using the same Apple Id that the iPad has for the App Store. For Paid Apps its best to consult with the App maker to make sure there is a compatible App. With the App Downloaded to iTunes on a computer you can go into The App Store App on your iPad, Tap on Purchased, and Look for the App there. Tap on it to begin the download. It will likely say its not compatible, but if there is a compatible version it will offer to download it. Install the latest compatible version of an app on an earlier version of iOS or OS X

Maybe you are looking for

  • Custom Slideshow Application Possible?

    Hey, new developer here, looking to make things using Xcode. Have a question I'd like awnsered if possible. I was looking for a slideshow app with some specific functions and couldn't find it. So I decided I might as well program one myself. I am jus

  • IMac ichat to macbook pro ichat and vice versa: audio/video call/chat not working

    Hi and thanks for your time! no green video/phone icon appearing beside buddy name. audio status/video status under view of the menu bar are ticked. ( i noticed this happened after i added "appleut01" AIM and did a test call. grayed out prior to said

  • Finding data element

    hi    i m new to idoc.i m trying to create the segment.in that i have 5 fields but i m not getting how to find data element for those fields.In y requirement they have just given fields like  Idoc   field                         XT01 message         

  • The keybord numbers doesnt work after 10.9.4 upgrade

    the day after y upgrade to maverick 10.9.4 the keybord numbers from 1 to 9 stoped working

  • How to Store UserID and Password on Server

    Hi, I m using Applet-Servlet Communication. When my applet calls Servlet it makes database connection and retruns Object to Applet. Can ne body pls. tell me instead of hardcoding database userid and password in servlet, what is a most convinient way