Is there a method for counting words?

Hi!
Is there a method for counting words?
How do I read specific data ( row, column ) out of an array?
Thx
Lebite

There's could be a better way, but this is how I would do it:
        String[][] myArray = { {"Blah Blah Blah"},
                               {"Blah Blah Blah"},
                               {"Blah Blah Blah"} };
        int tokens = 0;
        for(int i = 0; i < myArray.length; i++)
            for(int j = 0; j < myArray.length; j++)
StringTokenizer st = new StringTokenizer(myArray[i][j]);
tokens += st.countTokens();
System.out.println(tokens);

Similar Messages

  • Is there quick method for putting cloud songs on a new computer?

    Is there a quick method for putting cloud songs on a new computer?

    Setu iCloud on the new computer >  Apple - iCloud - Learn how to set up iCloud on all your devices

  • Is there a method for adding a character to a string?

    Hello,
    is there a String method to add a Char to a String given the character number on the string?
    EXAMPLE:
    String text = "hello world"
    I'd like to add a comma after the the 'o' (4th character) so I that text reads: "hello, world"
    is there something like:
    text.addChar(Char, position in string) ?

    avanrotciv wrote:
    Looce wrote:
    Strings are not modifiable. However, if you make a StringBuffer out of it, you can use its insert(index, String) or insert(index, char) method.This is what I was looking for Thanks.
    Should Strings just be directly modifiables? what's the reason they are not?The terms that are usually used are mutable (aka modifiable) and immutable (not modifiable).
    [_Why are Strings immutable?_|http://forums.sun.com/thread.jspa?threadID=5332008]

  • Is there a method for actually rotating the co-ordinates of 2D shapes?

    Hallo
    I'm trying to create a Graphics2D-powered program that needs to include polygons that can rotate. Now, as far as I can tell, affinetransform's methods will only ever transform the co-ordinate system of the User Space. So, for example, a GeneralPath object's co-ordinates will not change at all. Its useful only for rotating the Graphics2D display, not the underlying object.
    But I want to actually transform the co-ordinates of the Shape - e.g. select a rotation point (the centroid) of a Shape, and get a new set of co-ordinates for its points that rotates it by x radians. This is because I'm not using it just for display - it will be used to check what points are inside it, and needs to stick to the sprite it's used by.
    Is there any way of doing this - using a Shape object persistently, and just moving it and rotating it? Or do I need to make a new one every time, with new co-ordinates? Will I need to write my own rotate function? (Doable, just basic trig, but I kinda hoped there'd be a method somewhere...!)
    Cheers...

    sorry, the 'would you mind' wasn't meant to sound
    snotty! its amazing how bad forums can be for getting
    feeling across. I meant to say something like 'oh
    hell, I can't see how to do this. I don't suppose you
    happen to have an example lying around the place, do
    you?'
    I'll give it a go...I sounded a bit harsh perhaps. Sorry.
    I only saw someone give an answer and a couple of minutes later a follow-up asking for "example code", which lead me to believe you did not do any research/googling on what was suggested. I now read your original post and saw that you already knew of the AffineTransform class.
    Anyway, when I want to see some classes "in action" I always go to http://www.exampledepot.com . It also has some snippets on how to use the AffineTransform class:
    http://www.google.com/custom?domains=exampledepot.com&q=AffineTransform&sa=Google+Search&sitesearch=exampledepot.com&client=pub-6001183370374757&forid=1&ie=ISO-8859-1&oe=ISO-8859-1&cof=GALT%3A%23008000%3BGL%3A1%3BDIV%3A%23336699%3BVLC%3A663399%3BAH%3Acenter%3BBGC%3AFFFFFF%3BLBGC%3A336699%3BALC%3A0000FF%3BLC%3A0000FF%3BT%3A000000%3BGFNT%3A0000FF%3BGIMP%3A0000FF%3BFORID%3A1%3B&hl=en
    Good luck.

  • Is there a method for time jump / time skip rather...

    Hi all,
    I'm a new BT Vision user, and treying to ween myself off my beloved old PVR (Topflield TF5800).
    One of the most useful features on the Topfield was a Time Jump, set to the 4 colour buttons. I had mine set to Red +2 mins, Green + 1 min, Yellow +30 secs, Blue -10 secs
    As most ad breaks are 4 minutes, it was very quick to skip these on recorded programs, and much easier than using FF or RW.
    Is this possible with BT Vision?
    If not, is there any formal way to register feature requests?
    Thanks
    Solved!
    Go to Solution.

    The feature is already there.  You can FF and RW at varying speeds or you can skip forwards 30 seconds or back 7 seconds.  This is also available when using On Demand although there are no commercials in the On Demand content.  We use the 30 second skip a lot. You just use the >| button for 30 seconds forward and the |< button for 7 seconds back - these are next to the >> and << buttons respectively.
    The blue colour button is already tied up to search the TV Guide at any time and red button services can still be accessed when watching a programme on catch-up so they couldn't really be programmed as you describe.
    ---Remember to mark as 'solved' and give stars when you like a post---

  • Is there a method for retrieving the Adobe ID that performed a fulfillment?

    In the adept database, there is the 'userid' columns in many tables. Is there any way to get the actual Adobe ID using that or any other means to find out who performed a particular fulfillment?

    If by "AdobeID" you mean current email address for the AdobeID (as opposed to Adobe DRM GUID which is what is stored in the tables), then the answer is no there is no way to do this.
    If you want to find out who you think did this, the transaction ID is there, which you may have stored seperately with you own account information for the purchase.

  • Running Totals, is there a method for this

    Hello, I am racking my brain out trying to figure out how to do a running total based on each succeding input by the user. It goes like this, if a person has more then x, then it does an if else statement based on the value inputted, else something else. The problem that Im having is trying to figure out how to keep the total in and add it to each successive input, and allowing the whole thing to be ended with a while ! =1.
    Any suggestions would be so greatly appreciated.
    Best Regards,
    MT

    I Given below the solution for whatever understand from the question given below.
    For example if you run
    C:>java Tot 121 150 you will get the following output.
    Total No of Inputs : 2
    The Input value1=121
    The Input value2=150
    Total = 271
    public class Tot{
         public static void main(String args[]){
              System.out.println("Total No of Inputs : "+args.length);
              int total = 0;
              for(int pos=0;pos<args.length;pos++){
                   System.out.println("The Input value"+(pos+1)+"="+args[pos]);
                   total = total + Integer.parseInt(args[pos]);
              System.out.println("Total = "+total);
    Darma

  • Is there a method for suggesting apps that don't exist yet?

    As a frequent user of call forwarding, it would be great if when I input a phone number it displays as one of my Contacts. This would help avoid mistakes, such as mistyping my home phone number; I might miss that I inputted one wrong digit, but if Home didn't come up I'd see that immediately.
    Is there anywhere ideas like this can be posted?
    thanks.

    Smart album with face is none (I believe - check the available options)
    Unfortunately since iPhoto does not know that faces exist exist in photos that it has not found a face you will only get faces that you have not named - to see all photos with potential faces that iPhoto has not found you need to go through all photos and look - I used to add a keyword "face checked" after I went through a photo but fell behind and haven't gotten back to it - with that you can use keyword is not face checked to clean out ones you have done
    LN

  • Is there a method for reporting WL 10.0 download web page problem?

    The download file for WebLogic 10.0 on Linux is V16488-01.zip. The contents are for
    $ unzip -l V16488-01.zip
    Archive: V16488-01.zip
    Length Date Time Name
    803574241 2009-04-25 09:15 server1002_solaris32.bin
    803574241 1 file

    Yeah, it is a bit confusing.
    What you can try doing is creating dynamicStreamingResource and specify start time and end time.
    var resource:DynamicStreamingResource = new DynamicStreamingResource(VideoItem.base);
    resource.clipStartTime = startTime;
    resource.clipEndTime = endTime;
    The only problem is you will not be able to seek before the start time...
    If you find anything else let me know

  • Method for finding row count after executing query

    Is there a method for finding the row count from the resultset after executing a query on a database ?

    The best way: read the data from the result set. If you read it into e.g. a LinkedList, size() will tell you how many rows you got. Or you could increment a counter.
    There are other ways, such as variants of ResultSet that do the read loop for you. But since you'll be doing the fetch loop anyway, those just add unnecessary work and moving parts.

  • Method to count number of characters in a string?

    hi.
    i'm trying to write some script that will count the number of characters in a string passed into a constructor and then compare it against another value to check whether the string passed in is valid.
    something like this
    public class Stringcheck
    public static int maxStringLength;
    public static double minSize;
    public static boolean testStringLength(String x)
    // Insert method for counting number of chars in String x and name as 'int numberOfChars
    if(number of Chars <= maxStringLength )
    return true;
    else
    return false;
    can someone help me with writing this script.
    Thanks
    Richard.

    ummm, you dont need anything fancy. try:
    String test = "this is the test string";
    int length = test.length();

  • Is there a technique for restoring a missing app ie facetime to the ipad?

    Is there a method for restoring a missing app to the iPad?

    If it is not from the UAE, check your restrictions.
    Settings>General>Restrictions>FaceTime

  • BAPI for counting without inventory document?

    Hi,
    Is there a BAPI for counting without inventory document? Eg transaction MI10.
    Best regards,
    Morten

    Hi Morten,
    Can checkout these FMs:
    <b>BAPI_MATPHYSINV_GETDETAIL  </b>
    Read items for a physical inventory document     
    <b>BAPI_MATPHYSINV_GETITEMS    </b>
      Read list of physical inventory documents with items 
    <b>BAPI_MATPHYSINV_GETLIST       </b>
    Read list of phys. inv. documents                
    <b>BAPI_MATPHYSINV_POSTDIFF    </b>
      Post differences for certain items in a phys. inv. document
    Regards,
    Raj

  • Is there a reliable method for detecting that a query is too large?

    I am writing some code (that uses OCI) to properly detect when a query string is too long for OCI and/or the Oracle database server. I can't find any specific error code information in the docs, so I just started firing off large queries to see what would happen.
    The queries I am sending are >2MB in size, up to 16MB. If the queries are above ~10MB, I get the error "ORA-03113 'End-of-file on communications channel'" after a fairly short amount of time (i.e. not enough for a timeout to expire). If the queries are below ~10MB, but above ~2.5MB, it either just sits there and does not do anything (for more than 15 hours). So watching for ORA-03113 when executing large queries does not seem like a very reliable method for detecting the queries that are too large.
    Does anyone know of a reliable way of detecting that a query is too large for the OCI client and/or the Oracle database server?
    I am using version 10.2.0.1 for both the OCI client and the Oracle database server, but I'm getting similar errors for combinations of 10.2.0.1 and 9.2.0.7 for both the OCI client and the Oracle database server.
    These large queries need to be handled properly (i.e. distinguished from some generic failure) because the server handles requests from users, which could be programs that generate SQL queries (and have constructed huge ones in the past).
    Thanks for any information!

    The ORA-03113 means that the Oracle server process has died trying to satisfy your request. In almost all cases it is strictly correct to call that a bug, and we shouldn't easily forgive the server process when it happens. But in the case of multimegabyte statements my anger and disapointment turns to sympathy, for in my heart I can't bring myself to blame it. Can you?

  • Can someone please tell me a simple but effective method for burning a slideshow to DVD? Now that the connection between iPhoto and iDVD no longer exists, I can't figure out a way to get there with an acceptable quality result.

    Can someone please tell me a simple but effective method for burning a slideshow to DVD? Now that the connection between iPhoto and iDVD no longer exists, I can't figure out a way to get there with an acceptable quality result.

    Export the slideshow out of iPhoto as a QT movie file via the Export button in the lower toolbar.  Select Size = Medium or Large.
    Open iDVD, select a theme and drag the exported QT movie file into the open iDVD window being careful to avoid any drop zones.
    Follow this workflow to help assure the best qualty video DVD:
    Once you have the project as you want it save it as a disk image via the File ➙ Save as Disk Image  menu option. This will separate the encoding process from the burn process. 
    To check the encoding mount the disk image, launch DVD Player and play it.  If it plays OK with DVD Player the encoding is good.
    Then burn to disk with Disk Utility or Toast at the slowest speed available (2x-4x) to assure the best burn quality.  Always use top quality media:  Verbatim, Maxell or Taiyo Yuden DVD-R are the most recommended in these forums.
    If iDVD was not preinstalled on your Mac you'll have to obtain it by purchasing a copy of the iLife 09 disk from a 3rd party retailier like Amazon.com: ilife 09: Software or eBay.com.  Why, because iDVD (and iWeb) was discontinued by Apple over a year ago. 
    Why iLife 09 instead of 11?
    If you have to purchase an iLife disc in order to obtain the iDVD application remember that the iLife 11 disc only provides  themes from iDVD 5-7.  The Software Update no longer installs the earlier themes when starting from the iLIfe 11 disk nor do any of the iDVD 7 updaters available from the Apple Downloads website contain them. 
    Currently the only sure fire way to get all themes is to start with the iLife 09 disc:
    This shows the iDVD contents in the iLife 09 disc via Pacifist:
    You then can upgrade from iDVD 7.0.3 to iDVD 7.1.2 via the updaters at the Apple Downloads webpage.
    OT

Maybe you are looking for

  • How do I reduce the size of Firefox on my HP laptop. I don't want the ful screen.

    On start up Firefox covers the full screen. I manually adjust it, but on the next start up it does the same. I'm using a HP Pavilion dv1000 of indeterminate age . Any suggestions?

  • Lenovo V200 does not support 1920x1080 resolution

    I have a Lenovo V200 (0764-33G) with a LG W2343T external monitor attached which has a native resolution of 1920x1080. For some reason this resolution is not supported by the notebook. It is not a chipset issue as the Intel GM965 chip does support 19

  • Anyone used PL/FLOW with APEX in Oracle 11g?

    Greetings. I'm trying to find out if any of you have successfully used SourceForge's PL/FLOW with APEX in an 11g environment. References to PL/FLOW seem to be limited to 9i and I need to have some assurance that it would be compatible in a more updat

  • Trouble Downloading Movies Help?!?!?

    I got a macbook in June for a Grad gift and whenever i try to download any movies is opens up just as like a rich text format or something. How do i solve this problem?

  • Control Tab order?

    How can i control(customize) the Tab order? By default Tab order is from left to right on the Form, I need to change this order. Do i have to use focusLost/Gained ? Thx Ali