Search:

Type: Posts; User: Nuggets

Search: Search took 0.09 seconds.

  1. Replies
    12
    Views
    1,557

    Re: Substring Retrieval Method Question

    Can you guys help me out? My code seems to be printing the same output, no matter what I input. Here is the code,


    import java.util.Scanner;

    public class Assign4 {
    public static void...
  2. Replies
    12
    Views
    1,557

    Re: Substring Retrieval Method Question

    What's the difference between these two then if both return an integer?

    public int indexOf(int ch)
    Returns the position of the first occurrence of the specified character.

    public int...
  3. Replies
    12
    Views
    1,557

    Re: Substring Retrieval Method Question

    It's a program to check if an inputted variable name is proper or not. If the user enters say "street address", then the output should read "Illegal" because of the space.

    *Edit. My book does say...
  4. Replies
    12
    Views
    1,557

    Re: Substring Retrieval Method Question

    When I try and use " ", it gives me an error.
    String variableName1 = variableName.indexOf(" ");
  5. Replies
    12
    Views
    1,557

    Substring Retrieval Method Question

    Hows it going guys? Nuggets is back with another simple question for you java gurus here. The question is this.

    How would I return a space that has been entered as input using the indexOf method?...
Results 1 to 5 of 5