Search:

Type: Posts; User: literallyjer

Search: Search took 0.20 seconds.

  1. Re: Using recursion to find the number of occurences of a character in a string

    Look up the String.substring(int, int) method in the Java API.


    String s1 = "literally";
    String s2 = s1.substring(0, 7);
    System.out.println(s2) // prints: literal

    In our case, the substring...
  2. Re: Using recursion to find the number of occurences of a character in a string

    Then check to see if the first character of the string is the passed in character. If so, return one plus the results of the freq() with the first character removed from the string. Otherwise, just...
Results 1 to 2 of 2