Search:

Type: Posts; User: Norm

Search: Search took 0.09 seconds.

  1. Replies
    12
    Views
    1,959

    Re: Strings and Characters

    Just start with the loop.
    Then add the other stuff one thing at a time.

    There are hundreds of pieces of code on this forum and thousands on the internet.
    Search here or Google for samples.
    ...
  2. Replies
    12
    Views
    1,959

    Re: Strings and Characters

    Time to use the compiler and see what it thinks.
  3. Replies
    12
    Views
    1,959

    Re: Strings and Characters

    Not quite.
    You should use the length of the String to control the number of loops. Don't hard code a 4.
    You've mixed the data type and the variable name: char aChar = 0; char < 4; char++
    char is a...
  4. Replies
    12
    Views
    1,959

    Re: Strings and Characters

    You do it pretty much just like you asked:
    write a loop -> See for() loop for example
    in the loop get the char from the String one by one -> Read the String class API doc for the method
  5. Replies
    12
    Views
    1,959

    Re: Strings and Characters

    Ok. Normally I think of "display" as something that a human can see. Putting a value in an array is differeent than displaying it.
    You "display" a String by using System.out.println to a console or...
  6. Replies
    12
    Views
    1,959

    Re: Strings and Characters

    Have you read the String class API documentation? The String class has methods to get at the individual characters in the String. You could write a loop to iterate over the String and get the char...
Results 1 to 6 of 6