How do i get rid of this space?

okay, i'm having trouble with this method, i've tried so many ways to get rid of the single space before the "]" , if i do a "\b" anytime after the for statement is done, it just prints a small square.
   // prints out the prime numbers inside sieve
    public void printPrimeNumbers(){
        int n = 0;
        System.out.print("[");
        for(int i = 0; i < sieve.length - 1; i++){
            n++;
            if (sieve[i] == true && n != sieve.length - 1)
                System.out.print(i + " ");
        System.out.print("]");
    }for instance if i implement the following in client code
PrimeNumbers test = new PrimeNumbers (15);// new boolean array from 0-14
System.out.println( test ); // prints t or f if the index is a prime number
        System.out.println("There are " + test.getNumberPrimeNumbers(15) +
                           " prime nummbers in the sieve from 1 to 15");
        System.out.println("There are " + test.getNumberPrimeNumbers(25) +
                "  prime numbers in the resized sieve from 1 to 25"); // test is resized by a helper method
         test.printPrimeNumbers(); // prints the index of the array created inside the object if it is primehere is the output of the program:
[F F T T F T F T F F F T F T F F]
There are 6 prime nummbers in the sieve from 1 to 15
There are 9 prime numbers in the resized sieve from 1 to 25
[2 3 5 7 11 13 17 19 23 ]
my question is how do i get rid of the space in between the 23 and the ] , i've tried so many ways that have failed to do so.
Thanks

my question is how do i get rid of the space in between the 23 and the ] , i've tried
so many ways that have failed to do so.Just don't print it in the first place.public void printPrimeNumbers() {
    int n = 0;
    boolean first = true;
    System.out.print("[");
    for(int i = 0; i < sieve.length - 1; i++){
        n++;
        if(sieve[i] == true && n != sieve.length - 1) {
            if(first) first = false;
            else System.out.print(" ");
            System.out.print(i);
        System.out.print("]");
}[Edit] Too slow!

Similar Messages

  • How do I get rid of extra space in the toolbar section?

    There is a blank space between the Navigation Toolbar and the Tabs. It is the same height as the other Toolbars, and is very annoying. How do I get rid of this space?
    I tried pasting in a screenshot to show what I mean, but this form won't accept it.

    Sorry thought you had placed them both on the same toolbar.
    What you appear to have a a bookmarks toolbar without any bookmarks.
    Make sure that you have the check mark present for the bookmarks toolbar
    View > Toolbars
    Use "Ctrl+B" to bring up the bookmarks in the sidebar.
    You should have three major folders "Bookmarks Toolbar", "Bookmarks Menu" and "Unsorted Bookmarks".
    If you have no bookmarks or folders in the "Bookmarks Toolbar" that would be one reason for it to be blank, another and the only other one I think is currently possible through Firefox itself is that you don't have the wording "Bookmarks Toolbar Items" in the row when in customize, look for an item marked "Bookmarks" -- there are two such items you don't want the white star on a black background and drop-down, you want the the one with blue symbol on the right hand side -- drag it to the bookmarks toolbar, be careful in dragging you might drop it in the wrong toolbar.
    If that doesn't work use the "Restore Default Set" and then you have to re-customize your toolbars (but you placed a picture here that you could work toward).
    See picture at http://kb.mozillazine.org/Toolbar_customization_-_Firefox
    for during customize with "Bookmarks Toolbar Items" showing on the toolbar.]
    My own customizations seen in this picture
    * http://dmcritchie.mvps.org/icons/fx4toolbars.png
    :are described in the following
    You can make Firefox 4.0.1 and '''Firefox 5.0''' look like Firefox 3.6.17, see numbered items 1-10 in the following topic [http://dmcritchie.mvps.org/firefox/firefox-problems.htm#fx4interface Fix Firefox 4.0 toolbar user interface, problems (Make Firefox 4.0 look like 3.6)]
    and most of the major styling changes like color borders around tabs for status, and bookmarks bar with blue folders and red bookmarks are in the styling part items # 41 -45 (46 if you have multiple profiles).

  • My 'backup' is taking up a huge space on my hard drive but I have an external hard drive for my back ups - how do i get rid of this?

    Please can you help - I have recently added an external hard drive to my Macbook so it can be used as a back up and storage to save space on my hard drive.  I have deleted videos and photos from my hard drive but they are being replaced with 'backup'
    how do i get rid of this ?
    thanks

    Welcome to Apple Support Communities
    Time Machine makes local snapshots in all portable Macs with Lion or Mountain Lion. They are made in the internal drive and they are removed when your hard disk gets full, so you don't have to worry about it.
    If you want to delete them, turn off Time Machine and turn it on every time you want to make a backup. You can also turn them off manually without having to turn off Time Machine, or you can delete those local snapshots > http://pondini.org/TM/30.html

  • I need to free up storage on my iPhone 4s to do an update.  I have turned off my photo stream, but when I go into Usage Settings, it says that photo stream is using 3.7gb of space.  How do I get rid of this?

    i need to free up storage on my iPhone 4s to do an update.  I have turned off my photo stream, but when I go into Usage Settings, it says that photo stream is using 3.7gb of space.  How do I get rid of this?

    iCloud is not designed to "store" photos (as in long term storage).  iCloud can be used to sync photos from one device to another (photo stream) and to store a backup of the camera roll.  But that's pretty much it.
    Camera roll is the group of all photos taken by the device (but not other photos synced to the device from another source).  Your extra storage on icloud will do you no good.  The recommended way of storing photos on a device is to sync them to a computer.
    So, your questions..
    1) You don't/can't
    2) No, because of 1.
    3) On a computer, deleting large groups of photos is relatively painless.  not so on a device.
    4) You can't access photos on iCloud because they can't be store in icloud.  You can't view/access photos in a backup on icloud unless you restore a backup to a device.
    Read this...  import photos to your computer...
    http://support.apple.com/kb/HT4083

  • I imported a 1-hour long Soundcloud remix to Garageband and then cut it to the 2-minute part I wanted. But my garageband project is still 58 minutes of blank space (the toggle on the bottom) .. how do I get rid of this?

    I imported a 1-hour long Soundcloud remix to Garageband and then cut it to the 2-minute part I wanted. But my garageband project is still 58 minutes of blank space (the toggle on the bottom) .. how do I get rid of this?
    .. I didn't know how to shorten it to a question for the header

    stephgeske wrote:
    cut it to the 2-minute part I wanted. But my garageband project is still 58 minutes of blank space
    either drag the End of Song marker to the end of the clip:
    http://www.bulletsandbones.com/GB/GBFAQ.html#eos
    (Let the page FULLY load. The link to your answer is at the top of your screen)
    or export the exact length:
    http://www.bulletsandbones.com/GB/GBFAQ.html#exportexactlength
    (Let the page FULLY load. The link to your answer is at the top of your screen)

  • Pop up window saying my startup disc is full, I may need to delete files. How do I get rid of this?

    I just got this pop-up window tonight. How do I get rid of this?

    You need to, you know, delete things to create some free space on your disk.
    That doesn't mean you have to discard any data:
    If you have data you haven't looked at in a long time and aren't likely to need regularly, you can burn it to CD or DVD or some other storage media and then delete it from your internal hard drive. You can still access it when needed, but it won't be taking up space on your hard drive.
    A better but more expensive option is to purchase an external hard drive (as large as you can afford, with a FireWire-800 interface for best performance) and move as much as you can onto it. Your entire iTunes library is often a good choice as it tends to be full of movies, TV shows, and music videos which - together - tend to add up to a lot of disk space. The only downside is that you will be able to access that media only when you have the external drive attached, but if you spend a lot of time at your desk or otherwise in one spot with your laptop, it's not much of a downside.
    You could also get a larger internal hard drive, of cours, but they're non-trivial to replace in recent Apple laptops.

  • I can not sync ipod due to 6gb of 'other', how do I get rid of this?

    I can not sync ipod due to 6gb of 'other', how do i get rid of this?

    Hello drumsdonkey,
    Thanks for the question. The following article outlines issues with free space, capacity, and a large amount of "other" space. While it refers to iOS devices, most steps are applicable for your situation as well:
    iOS: 'Not enough free space' alert when trying to sync
    http://support.apple.com/kb/ts1503
    One symptom of this issue will be displayed in iTunes where the Capacity indicator for the iOS device will report a large amount of "Other" disk usage for the device. To resolve this issue:
    - Turn off the music or photo sync option in iTunes for the device.
    - Click Apply to sync the changes to the device.
    - Turn the music and photo sync options for the device on again.
    - Click Apply again to try to sync the device to iTunes.
    Thanks,
    Matt M.

  • 11.25 gb of "Other"...how can I get rid of this??

    I have an 32GB iPhone 4s with 11.25GB of "Other." How can I get rid of this or at least decrease it. It seems a little ridiculous for that much space to be used. I downloaded PhoneClean which freed around 1GB but didn't touch the "other" folder. I've seen several places on various sites to restore my iPhone.  My question to that would be, if I restore it, will I lose all of my texts? My contacts, calendar, etc are on the iCloud, so I'm not worried about those but I don't want to lose my texts. Any help would be greatly appreciated!
    Thanks so much!!
    K

    First of all, thank you for the information. I'm glad to know my texts will remain. I wasn't sure if a backup only included photos, videos, etc. Sometimes "backups" don't include everything, so I wasn't sure if everything was included with an iphone backup.
    Second, when I received your first response I thought you sounded rude but gave you the benefit of the doubt.  It's hard to hear one's tone when reading. However, upon reading your second response, I confirmed that you are in fact a jerk. It always amazes me that it makes some people feel good to make others feel bad.  Thanks for the warm welcome to the Apple forum by the way. I see you're from Atlanta...glad that southern charm is just shining through!
    Third, I didn't ask your opinion on how to run my business but since you commented on it I'd like to reiterate that my comment said "inconvenient." I certainly don't conduct business via SMS. In my business there are just certain tidbits of conversations that are nice to have on hand when I'm out and about.
    Again, thanks for the information. I hope this will solve my problem. Sorry to trouble you.

  • HT4623 I have an download that hasnt downloaded and my phone keeps asking me to put my apple id password in how do it get rid of this?

    I have an download that hasnt downloaded and my phone keeps asking me to put my apple id password in how do it get rid of this?

    Any error message?

  • In Mail, one mailbox for Recovered Message (AOL) keeps showing 1 very large message that I cannot delete. How can I get rid of this recurring problem, please?

    In Mail on iMac, successfully running OS X Lion, one mailbox on My Mac for "Recovered Messages (from AOL)" keeps showing 1 very large message (more than 20 Mb) that I just cannot seem to delete. Each time I go into my In Box, the "loading" symbol spins and the message appears in the "Recovered Messages" mailbox. How can I get rid of this recurrent file, please?
    At the same time, I'm not receviving any new mails in my In Box, although, if I look at the same account on my MacBook Pro, I can indeed see the incoming mails (but on that machine I do not have the "recovery" problem).
    The help of a clear-thinking Apple fan would be greatly appreciated.
    Many thanks.
    From Ian in Paris, France

    Ian
    I worked it out.
    Unhide your hidden files ( I used a widget from http://www.apple.com/downloads/dashboard/developer/hiddenfiles.html)
    Go to your HD.
    Go to Users.
    Go to your House (home)
    there should be a hidden Library folder there (it will be transparent)
    Go to Mail in this folder
    The next folder ( for me ) is V2
    Click on that and the next one will be a whole list of your mail servers, and one folder called Mailboxes
    Click on that and there should be a folder called recovered messages (server) . mbox
    Click on that there a random numbered/lettered folder -> data
    In that data folder is a list of random numbered folders (i.e a folder called 2, one called 9 etc) and in EACH of these, another numbered folder, and then a folder called messages.
    In the messages folder delete all of the ebmx (I think that's what they were from memory, sorry I forgot as I already deleted my trash after my golden moment).
    This was GOLDEN for me. Reason being, when I went to delete my "recovered file" in mail, it would give me an error message " cannot delete 2500 files". I knew it was only 1 file so this was weird. Why 2500 files? Because if you click on the ebmx files like I did, hey presto, it turned out that they were ALL THE SAME MESSAGE = 2500 times. In each of those folders in the random numbers, in their related message folder.
    Now remember - DONT delete the folder, make sure you have gone to the message folder, found all those pesky ebmx files and deleted THOSE, not the folder.
    It worked for me. No restarting or anything. And recovered file. GONE.
    Started receiving and syncing mail again. Woohoo.
    Best wishes.

  • The curser includes a text box from a previous image or link when the curser is positioned on the side of the page. i click and it goes away but only to return again on the next launched page. how do i get rid of this?

    the cursor includes a text box from a previous image or link when the cursor is positioned on the side of the page. it will mainly happen when i hit "back" from the page i was on. i click and it goes away but only to return again on the next launched page. i also keep several tabs open and it will carry over to any one of them i go to. how do i get rid of this?
    == This happened ==
    Every time Firefox opened
    == when i upgraded to most recent version 3.6.8

    A number of extensions can cause that problem, you'll need to do a little troubleshooting to find out which extension is causing that to happen for you.
    [http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes]

  • Hi! I sold my Iphone on ebay. The seller wants to connect the Iphone with his Apple ID, but it did not work because it says that the Iphone is already connected with another Apple ID. How can I get rid of this old connection? What do I have to do?

    Hi! I sold my Iphone on ebay. The seller wants to connect the Iphone with his Apple ID, but it did not work because it says that the Iphone is already connected with another Apple ID. How can I get rid of this old connection? What do I have to do?

    What to do before selling or giving away your iPhone, iPad, or iPod touch
    http://support.apple.com/kb/HT5661
    MaggySimpson wrote:
    Hi! I sold my Iphone on ebay.
    Follow the instructions to remove a device you no longer have.
    From here  >  http://support.apple.com/kb/PH13695?viewlocale=en_US

  • I get a recurrent request to connect by wi-fi to another computer on my wi-fi network, even if I am already connected to this other computer by wi-fi.  How do I get rid of this recurrent request?

    I have two MacBook Pros on my local wi-fi network.  I usually have these connected to each other over my wi-fi network.  Normally, I only connect to my old computer (MacBookPro) from the new computer (MacBookPro2), so I can access files on my old computer that are typically not on my new computer.  I use the same admin username (John Doe) and password on each computer.  Currently, I have Mavericks (10.9.5) on my old computer and Yosemite (10.10) on the new MacBook Pro.  All
    I am now getting a recurrent request to connect to old computer even when I am already connected!  When this request is being made, I am asked to connect to a username (johndoe instead of John Doe).  The exact alert:
         Enter your name and password for the server "MacBook Pro".
         connect as     << button is pressed for Registered User >>
         Name: johndoe
         Password: _________
         << Cancel button >>  << Connect button >>
    When I enter correct user name (John Doe or johndoe) and password for my account on Mavericks computer, the connection fails (whether I connected to Mavericks computer or not), and I get the following:
         There was a problem connecting to the server "MacBookPro".  The share does not exist on the server.  Please check the share name and try again. 
    If I change to the proper share name John Doe and use the correct password, I still am not connected and I get the same failure message and am asked to use the correct share name again.  If I cancel message, the connection message goes away for a while whether I am actually connected to old computer or not. It will then come back on the workspace I am currently using on my new macbook.  When I am downloading files using terminal, the connect request comes up constantly if I continue canceling the message which is really irritating.  How do I get rid of this constantly recurring request to connect???

    It means you must be connected to your computer via Wi-Fi (or cable).
    Or wait for iOS 5

  • I'm using 9.2.1.  Every time I open an album, I get a "face (the same one)" covering every picture. If I click on the picture, I can see the real picture.  How do I get rid of this "face" that covers all?

    I'm usingiPhoto 9.2.1.  Recently, everytime I open an album, I get a "face (the same one)" covering every picture. If I click on the picture, I can see the real picture.  How do I get rid of this "face" that covers all?

    Make a temporary backup of your library (if you don't already have a backup of it) and launch iPhoto with the Command +Option key held down and rebuild the library with options #1, 2, 3 and 6 selected.
    OT

  • A black airplay info window floats around on my HDTV screen when sending audio content via airplay up to sound system w Apple TV.  How can I get rid of this?

    A black airplay info window floats around on my HDTV screen when sending audio content via airplay up to sound system w Apple TV.  How can I get rid of this?

    Had this happen to me after a recent update, was super annoying.  To turn off, go to Settings > AirPlay > Conference Room Display > Off.

Maybe you are looking for

  • WBS Settlement Strategy

    Dear Experts, Please note that I have implemented SAP Note 211324, but still I am not able to see Account Assignment Category 5 - Superior WBS Element in customizing. http://wiki.sdn.sap.com/wiki/display/PLM/ModificationnoteforStrategyforsettlementto

  • Saving layout in ALV display

    Hi, I am using both is_variant, i_save parameters in this method, but still am not getting save layout button on my grid. ls_variant-REPORT = sy-repid.   CALL METHOD w_alv1->set_table_for_first_display     EXPORTING       is_variant                  

  • Wls 51 unable to start!! need some help

    hello here's my problem i 've installed weblogic5.1 on a machine win200 server and when i try to start the server i recieve this message ** unable to start server ********* **check root directory (weblogic.system.home) in login dialog**** and i get t

  • Validate the format of an email address?

    I've got a text field into which the user enters an email address.  Does anybody have a validation template that will make sure the email address is formatted correctly?   It doesn't have to tell if it's a valid email adress...

  • How to set a job to import automatically transport requests

    I wander how to set a job to import automatically transport requests