Help please. How do I reverse every second word in a sentence?

How do I reverse every second word in a sentence?
For example, I have a sentence" I am a noob programmer. "
It should be " I ma a boon programmer. " after I use the method.

public String ReverseEverySecondWord(String sentence) {
          String[] arr = sentence.split(" ");
          StringBuilder sb = new StringBuilder();
          StringBuilder tempSb;
          char[] cArr;
          sb.append(arr[0] + " ");
          for (int i = 1; i < arr.length; i++) {
               if (i % 2 == 1) {
                    tempSb = new StringBuilder();
                    cArr = arr.toCharArray();
                    for (int pos = cArr.length - 1; pos > -1; pos--) {
                         tempSb.append(cArr[pos]);
                    sb.append(tempSb.toString() + " ");
               } else
                    sb.append(arr[i] + " ");
          return sb.substring(0, sb.length() - 1);

Similar Messages

  • Can anyone help please. how do i get the home button to appear on the touch screen my home button has stopped working?

    can anyone help please. how do i get the home button to appear on the touch screen my home button has stopped working?

    I have same problem.
    However, I am unable to turn on Assistive Touch.
    At one time I was able to activate it, but it went away and now I cant reactivate.
    What is the solution?

  • Hi, folks can some body help me¡  How  I can  use  de second  code  to  the  Itunes card  to  use  the  Itunes card.... My  number is vanished, how  i can submit  my  Itunes card?

    Hi, folks can some body help me¡  How  I can  use  de second  code  to  the  Itunes card  to  use  the  Itunes card.... My  number is vanished, how  i can submit  my  Itunes card?

    iTunes Store: Invalid, inactive, or illegible codes
    http://support.apple.com/kb/TS1292

  • Any advise on how I can turn just one word in a sentence upside down, as opposed to all flipped

    Could someone advise on how I can turn just one word in a sentence upside down, as opposed to all flipped. Im trying to make one word stand out whilst designing in a text sentence window.
    Thanks In advance

    It’s best to type your sentence and then click on the hand tool to deselect the Type tool
    Click the type tool again and type the word you wish to rotate (it will be on a separate layer.
    Select the layer with the full sentence and add a layer mask.
    Choose the brush and paint with black to mask the word in the sentence.
    Select the layer above with the single word and use the move tool to rotate and position it. Then save.

  • HELP PLEASE How do I remove my credit info from iOS7. "None" is not there anymore as a selection btw help.

    Please help idk how to remove credit information the "none" selection is gone now ios7 plz help

    Yes it is...

  • Help with a loop to read every 10th word

    i have this loop which reads in every 10th word starting from position 1, from the vector but now i want to be able to loop though it again and get every 10th word starting from pstion2 so when i first print it out it prints out words 1, 11, 21, 31 and so on and then i loop though it again to print out words 2, 22, 32, 42 and so on and then 3, 13, 13, and so on could anyone give me any solutions please
    thanks jason
    Enumeration e = v.elements();
    Object o;
    for(int i = 0;e.hasMoreElements();i++) {
    o = e.nextElement();
    if (i%10 == 0){ System.out.println(o.toString()); }

    Use code tags when posting code.
    It's interesting that some other guy asked about a for loop like that a week ago. (http://forum.java.sun.com/thread.jsp?forum=31&thread=323439) Are you the same person with a different name? Or are you taking the same course?
    As I said when I answered that question, and as should be pretty selfevident if you actually understand what the for loop you have is doing, you can select which word you print out by changing the initial value of 'i' in your loop. To print word number 2,12 etc you set 'i' to
    9 at the start.

  • Help Please: How to Undo Tables to AP divs

    I think I did something silly! I was playing around in Dreamweaver on and I was looking under the tabs > Modify > Convert > Tables to AP divs. So I clicked on "Tables to AP divs" (just to see what it would do) THINKING that anything I would have done I would be able to "undo" - well no, I couldn't undo it. The page is titled "RequestOrder". Then I opened up another page called "RequestInspection" and this also effected that page! I opened up a whole other website and all pages titled "Request[any name]" also had the same effect! Any pages that do not have "Request" in the title have not been effected.
    Can someone please tell me what I did wrong and how to please undo it? When I view the pages in the browser everything looks normal. But I would like it all to go back to the way it was.
    I have learned my lesson - not to just click on something just to see what it does...usually I don't get into a situation where I cannot undo something.
    Thanks so much!!
    -J
    Example of what the page looks like in Dreamweaver:

    JanineP wrote:
    I have learned my lesson - not to just click on something just to see what it does...usually I don't get into a situation where I cannot undo something.
    My father said the same thing four times in 2009, after I had to reformat his entire system in 2008, 2007 and 2006 for things he "clicked on to see what they did". What they did was install rootkit viruses that even AVG couldn't remove.
    I don't touch his system anymore. A local company does it for $200 a shot... This is a $300 e-machine we're talking abut and he spends $800- $1000 a year to "clean it up" because he STILL hasn't learned to investigate things before putting his files at risk by clikcing things.
    You CAN undo this, but it won't be with a single click (sorry to disappoint you). Even if there were a "one click" way to do it, I'd recommend that you do what I'm going to suggest as a lesson in why you don't click things "just to see what they do" with something important.
    Open your site one page at a time and above every APDiv, insert a new table, then copy (one cell at a time) the content from the APDiv to the table, and delete the ADiv.
    Better yet, since using TABLES for LAYOUT is a bad practice that has been shunned for about seven years now, just start with a new page, using CSS and (not AP) DIVs, and lay it out all over. Then copy the content from your main body into the proper sections and "Save As" to replace each page with one that is W3C compliant and a lot simpler.
    Sorry if that sounds a little sarcastic, but I just got off the phone with a 'friend' who wants me to come over and clean up her PC because she opened an infected e-mail and her six months expired trial of McAfee can't help.I just lost a friend, but saved myself a migraine.

  • HELP PLEASE~How to turn the buzz off my iSight iMacG5...

    Hi all,
    I seriously need some help here. I've got my iMac 20" couple weeks ago, and it was quiet at first. I didn't hear the buzz sound coming from the middle left until maybe about 3~5 days. Now my roommate just got a 17" iSight iMac, which is whisper quiet. I still can hear the fan or air goes in and out from her machine but it is totally acceptable unlike mine...
    I thought it was due to the upgrade to 10.4.3, so I reinstalled the OS again but the sound's still there. I then took it to a mac store to examine it. This evening a techincian told me it normally functions in a quiet room and he thinks everything's right, so I took it back but the sound's still there...
    Few iMac 20" users here also have the same buzz problems like mine. I really hope it becomes as quiet as the first time I got it, so please let me know if you have any ideas to solve this...The buzz really annoys me especially when I don't hear anything from my roomate's...
    Any input will be much appreicated. Thank you.

    Why don't try reseting the SMU here are the Directions on how to do it.
    The SMU (System Management Unit) is a microcontroller chip on the logic board that controls all power functions for your computer. If your computer is experiencing any power issue, resetting the SMU may resolve it. The SMU controls several functions, including:
    Telling the computer when to turn on, turn off, sleep, wake, idle, and so on.
    Handling system resets from various commands.
    Controlling the fans.
    Note that resetting the SMU does not reset the PRAM. Resetting the SMU will not resolve issues in which your computer is unresponsive—in these situations, restarting your computer will generally suffice. If your computer isn't responding, perform these steps one at a time, in this order, until the issue has been resolved:
    Force Quit (Option-Command-Escape).
    Restart (Control-Command-Power).
    Force Shut Down (press the power button for 10 seconds).
    Resetting the SMU can resolve some computer issues such as not starting up, not displaying video, sleep issues, fan noise issues, and so on. If your computer still exhibits these types of issues even after you've restarted the computer, try resetting the SMU. To reset the SMU on an iMac G5 (Ambient Light Sensor) computer, simply do the following:
    Turn off the computer by choosing Shut Down from the Apple menu, or by holding the power button until the computer turns off.
    Unplug all cables from the computer, including the power cord.
    Wait 10 seconds.
    Plug in the power cord while simultaneously pressing and holding the power button on the back of the computer.
    Let go of the power button.
    Press the power button once more to start up your iMac.
    Unlike earlier iMac G5 computer models, the iMac G5 (Ambient Light Sensor) and iMac G5 (iSight) computers do not have a button on the main logic board for resetting the SMU. This eliminates the need to remove the computer's back cover to reset the SMU.
    Post back, Miguel

  • Help Please: how can I burn a dvd movie without a theme?

    I know this has been asked before. But none of the previous answers/suggestions seem to work. I've tried to use the "looping" method from the help menu, I still get a theme, now at the end of my video "package". And it doesn't "loop". I've tried to take a jpeg from photos and cover the theme using the option key, but that doesn't work either. I just want to have the option to be able to "turn off" the themes and create a clean video dvd for people who don't have time to choose on-screen buttons. Thanks in advance for any help you can provide

    Hey maybe you can help me. I was trying to figure out how to burn an iPhoto slideshow on iDVD, but don't want to use the lame Apple themes. I went to the link you pointed out about one-step iDVD's, but the problem is you have to have a movie, and iPhoto won't let me export my slideshow while keeping the music in sync. Insane.
    So two questions... do you know how to export a slideshow to .M4V or .MOV without losing the sync between all the pictures and the music? I've got 88 slides all set to specific timing and Ken Burns effect, but every time I do an export the music becomes disconnected from the pictures and goes out of sync.
    I did do an export to iDVD and it seemed to stay in sync but I can't figure out how to get rid of the ridiculous theme that iDVD is automatically using. I don't want a theme at all.
    When is someone at Apple going to figure out that most people just want a plain wrapper?
    Anyway, do you know any answers to my problems? Thanks. I've lost 4 slideshows this week as iPhoto keeps losing all the slide settings.

  • Help please - how do i back up my pc photos to icloud so that they stay there??

    Hi,
    This is possibly the stupid question of the day but please bear with me and help if you can, as I've searched and just can't figure it out. I'm not usually PC illiterate!! I'm trying to work out how to back up my PC photos (Windows 7) to icloud. I thought it might be as simple as pasting them into photostream but apparently if they're linked to photostream they only stay there for 30 days. I am totally lost but have bought sufficient storage space to be able to hold them all.
    I would really appreciate any help - really struggling to work it out, whilst simultaneously entertaining 1 year old!!
    Thanks in advance

    iCloud Photo Library beta FAQ - Apple Support

  • Help Please: how to set JDBC properties for data encryption in BC4J

    Hello,
    I am trying to implement JDBC Thin Driver Support for Data Encryption and Integrity.
    With java.sql.Connection and java.util.Properties, one would do something like the following code:
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    Properties props = new Properties();
    int level = AnoServices.REQUIRED;
    props.put("oracle.net.encryption_client", Service.getLevelString(level));
    props.put("oracle.net.encryption_types_client", "( RC4_40 )");
    props.put("oracle.net.crypto_checksum_client",Service.getLevelString(level));
    props.put("oracle.net.crypto_checksum_types_client", "( MD5 )");
    Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@localhost:1521:main", props);
    But, how can we do this with BC4J objects? Can we set this properties via EnvInfoProvider class? Please help. Thank you very much in advance.
    Zhirong

    Hi,
    Try adding the code in the PBO part of your custom program used for the custom screen which you have created and added inside the BADI.
    Regards,
    Harish

  • I use OSX version 10.8.5 and iphoto on a MAC.  I upgraded to elements 12 and in IPHOTO it keeps going to Elements 9???  Help please - how do I make it reference the new version???

    I have a MAC and use IPHOTO and had used Adobe Elements 9 as the external Editor and IPHOTO as default.  NOW I upgraded to Adobe elements 12 and IPHOTO only recognoizes Adobe Elements 9???  HOW do I make it go to the new external editor??  I appreciate any help you can provide?

    You need to reset the external image editor in iPhoto's Advanced preference pane to the right version. I assume there's an Adobe Photoshop Elements 12 folder in your Applications folder.  This screenshot is for PSE 10 but would be the same for 12:
    Happy Holidays

  • Help please - how to set an alarm with time?

    Hi guys,
    I have got a task here, basically it required me " to displays the time and can set an alarm, which sounds at the right time." (when match it)
    Well, I have created 2 edit boxes, and a button and a radio box. When I typed both the equal string into the edit box, the string will say match! However,I couldn't show the time that run by thread code...
    any guess?
    here is the code:
    import java.awt.*;
    import java.applet.*;
    import java.awt.Graphics;
    import java.util.Date;
    public class j27 extends Applet {
    AudioClip audClip;
    String Msg1=null;
    String Msg2=null;
    Label info;
    TextField box1Text;
    TextField box2Text;
    Checkbox charTrue;
    int myVar1=0, myVar2=1;
    Font theFont=new Font("TimesRoman", Font.BOLD, 24); //
    Date theDate; //
    Thread runner; //
    public void init() {
    info = new Label ("string and integer demo j27.java");
    add (info);
    box1Text=new TextField("12");
    add (box1Text);
    box2Text=new TextField("34");
    add (box2Text);
    Button load=new Button("process");
    add (load);
    charTrue=new Checkbox ("treat input as text");
    add (charTrue);
    public boolean action (Event event, Object object) {
    if(event.target instanceof Button) {
    Msg1=box1Text.getText();
    Msg2=box2Text.getText();
    if (charTrue.getState() !=true) {                    //test for text or integer input
    myVar1 = Integer.parseInt (Msg1); //if integer input convert string
    myVar2 = Integer.parseInt (Msg2); }
    repaint(); }
    return(true);
    public void start()
    if (runner == null)
    runner = new Thread (this); //new thread
    runner.start();
    public void stop() {
    if(runner!=null) {
    runner.stop(); //kill thread
    runner = null; }}
    public void run()
    while(true)
    theDate = new Date();
    repaint();
    try {Thread.sleep(1000);} //thread sleeping 1 second
    catch (InterruptedException e) {}
    public void paint (Graphics g) {
    g.setFont(theFont);
    g.drawString(theDate.toString(),10,50);
    if (Msg1 !=null) g.drawString( "box1=" + Msg1, 30, 140);
    if (Msg2 !=null) g.drawString( "box2=" + Msg2, 30, 150);
    if (charTrue.getState()==true) {                               //text for text or string
    if (Msg1.compareTo(Msg2)==0) g.drawString ("strings match!", 30, 160); }
    else
    if (myVar1 == myVar2) g.drawString ("integers match!", 30, 170);
    else
    audClip = getAudioClip(getCodeBase(),"loop.au");
    audClip.loop();
    }

    Please use:
    &#91code]
    //my code here&#91/code]
    when posting code

  • Mr. Steven help please : How you can pass paremeter by(ADF)

    if you have two tables
    (table a : E_mail{primary key},a_name)
    (table b : E_mail{primary key},b_name)
    & the relation between this tables by {E_mail} .
    I create view have this two table(two entity) , but i hide the fields
    E_mail & b_name from (table b) , then i drag and drop this view to JSP
    page called (saveData) and put Commit and create . So, what i need ?
    When i commit the page(saveData)i want put E_mail from (table a) to E_mail(table b)
    How i can do it ?????
    ==> if you have an example please give it to me ?

    I am working with JDev 10.1.2
    -what i did ?
    -(1)I create view have the entity objects(from two table) named : testview-
    (2)i am go to java file of the view(testview) and write :
    public void seta_Email(Number value)
    setAttributeInternal(a_Email, value); //from table A
    setAttributeInternal(b_Email, value); //from table B
    protected void create(AttributeList attributeList)
    a t1 = get_a();
    b t2 = get_b();
    try
    t1.create(attributeList);
    t2.create(t1);
    }catch (JboException ex)
    t1.revert();
    t2.revert();
    throw ex;
    (3)then i am go to AppModule(javafile) and write :
    public void account()
    ViewObject vo = get_bView1();
    vo.clearCache();
    vo.setMaxFetchSize(0);
    vo.executeQuery();
    Row newRow = vo.createRow();
    vo.insertRow(newRow);
    newRow.setNewRowState(Row.STATUS_INITIALIZED);
    vo.setCurrentRow(newRow);
    (4) .................
    then what i do ????
    please Mr.Steven tell me what's next step ???

  • Some help please: how to remove incompatible audio units?

    Hello forum readers,
    If someone knows, a little help would be appreciated:
    When staring Logic Pro X, each time Audio Units are automatically being scanned. All the time I get a window with the message "Incompatible Audio Units found":
    "While verifying Audio Unit compatibility, Logic Pro X encountered 1 Audio Unit plug-in(s) which did not pass the Apple AU validation. These plug-ins have been excluded from further usage in Logic Pro X to prevent possible problems or crashes. You can start the AU Manager now to review the validation results or continue the startup process."
    When opening the Audio Units manager, I see that "AUSpeechSynthesis (Automap)applttsp"  (Manufacturer: Apple, type: generator) couldn't be opened. I don't know how to remove or bypass this plug-in, as the option "disable failed audio units" doesn't seem to work. Now each time I start Logic Pro X, the same message keeps appearing. I also can't find that file on my Mac, a searched for it and also the Finder can't find it.
    Does anyone know how to solve this? Thanks a lot in advance!
    Kind regards,
    Thijs

    I have the same problem but I can´t figure out how to unwrap AUSpeechSynthesis. I can´t even find it in the filesystem with spotlight.....   ;o(
    And yes I have turned on the 64bit plugin friendly option in Automap's Preferences.
    Thanks for your help!

Maybe you are looking for

  • PO print out issue

    Hi Guru , This is very interesting issue regarding PO print out. i have developed Zform for PO  . I have assign this form in NACE setting. Ok then i have created a PO and define Message type for that PO Like ... Out Put type - NEW, Medium - Print Out

  • Condition type FRA1, condition category B and returns item

    When a delivery is not accepted and returned, a new purchase order is created where the field returns item flagged. Conditions like ZPB0 becomes a negative value, but the FRA1 not. In our business it is common not to pay the transport costs if the de

  • Capturing data in Xi...

    im not able to retrieve data from xi i.e the function module response is im using the RFC STFC_CONNECTION...to test AS A CONNECTION BTWEEN r3 AND XI... when i execute this RFC , im gettin response in R3.can someone help me know how to capture the res

  • Find texts with more than one Character Style applied

    Hi, If you need to find - and replace/restyle - texts where more than one Character Style is applied - here is tool for you - for ID CS3 and ID CS4: http://www.adobescripts.com/search.php?query=multi+findreplace+grep&action=results You can define opt

  • While installing OBIEE on linux box

    Hi, while installing OBIEE on linux box i am getting below error ./setup.sh Unable to load the launcher file index. Cannot open launcher file. can any one let me know how to reslove this issue... Regards Venkata