Regular Expression - Extract words before the PLUS Sign ?

Dear All,
I had many words with having a symbol plus. I need to extract the words before the plus sign.
I can able to do this by using String.indexOf or String.contains. But i like to know is there is any way to do this using Regular Expression.
sample string
Kathire+san Output Kathire
World+islike Output World
Thanks,
J.Kathir

Here's one way.
import java.util.regex.Pattern;
String input = "abc+def";
Pattern pat = pat.compile("\\+");
String beforePlus = pat.split(input)[0];
Sun's Regular Expression Tutorial for Java
Regular-Expressions.info

Similar Messages

  • Before 4.0 I could right click on an open tab and start a new tab. Now the option to do so is no longer on the right click menu, and I have to click the plus sign.

    Before 4.0 I could right click on an open tab and start a new tab. Now the option to do so is no longer on the right click menu, and I have to click the plus sign if I want to open a new tab. It is kind of bugging the hell out of me. Is there a way to fix it other than uninstalling and reinstalling the old firefox? Because this is a big part of the way I browse.

    You can also use ctrl-T or File > New tab (if you have the menubar showing). I can't find an extension that will help you bring back the previous behavior but there probably will be one soon.

  • After updading my iphone 3gs to ios 5.0.1 ive lost the ability to ad appointments to my calendar simple the plus sign is not existed anbnymore

    after updading my iphone 3gs to ios 5.0.1 ive lost the ability to ad appointments to my calendar simple the plus sign is not existed anbnymore

    I feel better knowing I wasn't going crazy this morning. After spending the last 15 hours tweaking iTunes Match, I was afraid the service was draining my battery, but then I just let it sit idle on my desk at work and periodicaly checked it, every 30 minutes I lost 5% when it was in standby. When I was checking mail in 5 minutes, the battery drained 1% each minute. After a full night charge last night the day of standby has brought me down to 43%. I normally charge my 4s every other night, and I listen to Pandora and TuneIn Radio regularly. I have a feeling it hasn't affected everyone, just like I had no issue before, but clearly have a massive issue now.
    SERIOUSLY, APPLE. Make an announcement acknowledging this garbage. If my device doesn't get its normal battery life back, the poor folks at my local Apple Store are going to have my family and I raging the place.

  • Won't type the "plus" sign or the underscore

    Hey all,
    So my comp won't type the "plus" sign or the underscore. Shift works with all the other keys, but not those two. I can type = and -, but shift doesn't work with these keys. I can also type ± and — which are "shift alt" and ≠ which is "option =" It's just the underscore and plus sign that won't show up.
    My language is set to English but sometimes I use Spanish as well.
    This problem is not software specific either, it won't type those two characters in any program, be it word processing, browser, or instant messaging.
    Restarting fixes the problem but eventually my ability to type these two characters vanishes.
    Help?

    Check system preferences/speech to make sure that these keys are not set to be the trigger for either speech recognition or text to speech.
    Check system preferences/keyboard/keyboard shortcuts to make sure they are not shortcuts for anything.
    Try setting up another user account and see if the same problem exists when logged into that.

  • Firefox is not allowing me to add new tabs. I'm pushing the plus sign next to my tab, and it is no longer adding new tabs. How do I fix this problem?

    When I open Firefox, I automatically have one tab. The plus sign button to add more tabs is next to the one tab, but it no longer adds tabs when I click on it. When I click on it, it doesn't do anything. How can I fix this problem so I can have multiple tabs? I downloaded the most current version of Firefox, and I'm still having the same problem. I've had this problem for a little over a week now.

    The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your essential information.
    Note: ''This will cause you to lose any Extensions, Open websites, and some Preferences.''
    To Reset Firefox do the following:
    #Go to Firefox > Help > Troubleshooting Information.
    #Click the "Reset Firefox" button.
    #Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
    #Firefox will open with all factory defaults applied.
    Further information can be found in the [[Reset Firefox – easily fix most problems]] article.
    Did this fix your problems? Please report back to us!

  • I am unable to create a new event on my iPhone with IOS 7.0.4. I tap the plus sign, fill in the details, tape Done and ... nothing. Repeatedly. No problem on my iMac or iPad, just with the phone. Help.

    I am unable to create a new event on my iPhone with IOS 7.0.4. I tap the plus sign, fill in the details, tape Done and ... nothing. Repeatedly. No problem on my iMac or iPad, just with the phone. Help.

    Assuming you're creating this event to place in your calendar, and assuming this calendar is shared with your iMac and iPad using iCloud, might the calendar be restricted on your iPhone?
    Check Settings > General > Restrictions

  • How do I apply a grep style to the plus (+) sign?

    I was able to apply a grep style to the minus and equal sign, but not the plus sign "+".  It appears the plus sign means 'apply to all' in the grep style box.  Can some assist me with this? Thanks in advance.

    Thank you. It worked perfectly.

  • How to use the plus sign (+) in URLs

    I have a procedure that takes a name as a in parameter. When the value of the name got a plus sign in it, the browser can't find the page/procedure. It works for every name without the plus sign.
    Ie. the following is an exsample of an URL with plus sign in the value of a parameter:
    http://svvmetaapp01.vegvesen.no:7778/pls/portal/PORTAL.wwa_app_module.link?p_arg_names=_moduleid&p_arg_values=2435397421&p_arg_names=_show_header&p_arg_values=YES&p_arg_names=NODE_ID&p_arg_values=5&p_arg_names=_node_id_cond&p_arg_values=%3D&p_arg_names=NT_ID&p_arg_values=32&p_arg_names=_nt_id_cond&p_arg_values=%3D&p_arg_names=NAVN&p_arg_values=C[b]++&p_arg_names=_navn_cond&p_arg_values=%3D
    Any tip?

    Check the supplied PL/SQL package UTL_URL and you might get idea to solve your problem.
    Thanks
    -Krishnamurthy

  • I can't open new tabs by clicking on the plus sign, or in file new tab

    Whereas previously it was possible to open a new tab by clicking on the "plus" sign at the right of the last open tab, or by selecting "file" and "new tab", neither of these options work. New tabs will open for a new webpage, but a "blank" will not appear.

    This issue can be caused by the Ask<i></i>.com toolbar (Tools > Add-ons > Extensions)
    Your system details show that toolbar in the user agent as AskTbBLPV5/3.13.1.18107
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • When I want to open a new tab the plus sign doesn't work. What do I do to make that feature work?

    This is a problem that I have found many work arounds to but I do not like to have to click on several things or push several buttons and would rather just click on the plus sign like in my sub accounts for win7.

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • After IOS 5, iCal is missing the Plus Sign

    After I updated to IOS 5,  the iCal app is missing the Plus sign.   Everything else seems OK,  but there is no plus sign to add a new calendar entry.
    I will try to restore/backup and see if it comes back, but I'd really appreciate any advice you might have.

    Just found another post, where the problem seemed to be due to the way sync with iTunes was set up.   I'll check that out.   

  • No new tab will open in Firefox-not ctrl t, not in the file menu, not on the plus sign on the open tab

    I use Firefox 3.6 on a windows xp sp 3 desktop. I cannot open a new tab in Firefox. I uninstalled the program, reinstalled the newest update, 3.6.1.4 still nothing. Not in the file menu, on the plus sign on the open tab, control T, none of it opens a new tab. I can open a new window but----

    There is a reported incompatibility between current Firefox versions and the '''''Ask Toolbar'''''. Until Ask fixes the problem, disable or un-install the '''''Ask Toolbar'''''.
    *http://support.mozilla.com/en-US/kb/Uninstalling+add-ons
    *http://support.mozilla.com/en-US/kb/Cannot%20uninstall%20an%20add-on

  • The plus sign in the calendar of my iPhone 4s is not red.

    When I go in to my calendar on my iPhone 4s the plus sign is not red so I can't add appointments to my calendar on my iPhone 4s. How can I fix this?
    It is very annoying and I need tI put things in my calendar. Please help me.

    Check the mute switch along the side, near the external volume controls.

  • The screen no longer displays a playlist column and when I hit the plus sign the screen no longer has a right side column to let me make a new playlist. Now what?

    The screen which comes up no longer displays a playlist column and when I hit the plus sign and choose new playlist the screen doesn't display the narrow right side column for a new playlist. Does this have something to do with the new iTunes version I installed?

    iOS: Unable to update or restore

  • What does the plus sign after certian items mean?  i.e. ""+Math.round(+s);

    Hello,
    I was wondering what the plus sign does in the following line of code:  ""+Math.round(+s);
    What does it do to +s ?
    What does it do to +Math.round ?
    Thanks
    Linda

    So basically the following code:
    " " +Math.round(+s);
    makes sure that the value of s is numeric, rounds it up and then converts the number to a string.
    Thank you GKaiseril
    Linda

Maybe you are looking for