Search:

Type: Posts; User: Kimimaru

Search: Search took 0.14 seconds.

  1. Replies
    10
    Views
    4,042

    Re: Getting length of individual token?

    Thanks for the advice DanBrown.

    Unfortunately, I had to study all of last week for midterms, so I didn't have the full 2 weeks I needed to spend on this program. On top of this, I have a lot of...
  2. Replies
    10
    Views
    4,042

    Re: Getting length of individual token?

    Okay, left-justification is working fine! Now I need to include right-justification and centered text. My right-justfication code is as follows:


    public static void Rformat(int winput, String...
  3. Replies
    10
    Views
    4,042

    Re: Getting length of individual token?

    This is what I came up with so far:


    while(sinput2.hasMoreTokens())
    {
    String temp = sinput2.nextToken();
    System.out.println(temp.length());
    count += temp.length();
    ...
  4. Replies
    10
    Views
    4,042

    Re: Getting length of individual token?

    I tried: "count = sinput2.length();" and "count = sinput2.length;" and it says it cannot find the symbol of length. I've used length for arrays and normal strings and it worked; I'm not sure why it's...
  5. Replies
    10
    Views
    4,042

    Re: Getting length of individual token?

    Thanks for the feedback, but my problem was that I didn't know how to get the length of each token. What function can I use to do so?
  6. Replies
    10
    Views
    4,042

    (SOLVED) Getting length of individual token?

    Hello! I'm making a program that formats inputted text based on the line width the user inputs and the type of formatting the user chooses (left-justified, right-justified, centered). I'm not allowed...
Results 1 to 6 of 6