Search:

Type: Posts; User: Sean4u

Search: Search took 0.08 seconds.

  1. Replies
    18
    Views
    5,796

    Re: Matcher object .find() method question

    I think you should have a .appendTail in there for input strings that *don't* end in a vowel. The find / appendReplacement loop is basically what replaceAll does. You would use find /...
  2. Replies
    18
    Views
    5,796

    Re: Matcher object .find() method question

    You could use group() and do this the hard way, one match at a time (although I imagine almost any way you do this will be creating lots of intermediate strings, it's just that some of them won't do...
  3. Replies
    18
    Views
    5,796

    Re: Matcher object .find() method question

    Did you experiment with capturing groups in your Pattern? Your program is a one-liner (if you use the convenience method String.replaceAll(String, String)) or a three-liner if you use Pattern and...
  4. Replies
    18
    Views
    5,796

    Re: Matcher object .find() method question

    Soz, that's not right. I misread your code. You need to think about how you're building your new string. Why are you using insert()? If I understand correctly, you should be finding a letter, adding...
  5. Replies
    18
    Views
    5,796

    Re: Matcher object .find() method question

    So close! Read the API doc for Matcher.start(), then go back up to find() and read the next method name down. Which one of those two should you be using?
  6. Replies
    18
    Views
    5,796

    Re: Matcher object .find() method question

    API docs:

    After it has found the next one, the find method is done and returns true. When there are no more to find, the find method returns false. If you want the next next one, you'll have to...
  7. Replies
    18
    Views
    5,796

    Re: Matcher object .find() method question

    I'm not sure I understand your code. Are you expecting Matcher.find() to work in an if statement the way that String.charAt(int) works in a for loop?
Results 1 to 7 of 7