Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

You say letter, you say word, what do you search exactly?

I you search word, you have to search a word inside word boundaries: regex java.util.regex.Pattern \b as shown by anubhavaanubhava.

You may replace } else if (indexfound < -1) { by } else { because java.lang.indexOf() return -1 when not found >-1 otherwise, < -1 does never occurs.

You say letter, you say word, what do you search exactly?

I you search word, you have to search a word inside word boundaries: regex java.util.regex.Pattern \b as shown by anubhava.

You may replace } else if (indexfound < -1) { by } else { because java.lang.indexOf() return -1 when not found >-1 otherwise, < -1 does never occurs.

You say letter, you say word, what do you search exactly?

I you search word, you have to search a word inside word boundaries: regex java.util.regex.Pattern \b as shown by anubhava.

You may replace } else if (indexfound < -1) { by } else { because java.lang.indexOf() return -1 when not found >-1 otherwise, < -1 does never occurs.

Source Link
Aubin
  • 14.9k
  • 11
  • 67
  • 89

You say letter, you say word, what do you search exactly?

I you search word, you have to search a word inside word boundaries: regex java.util.regex.Pattern \b as shown by anubhava.

You may replace } else if (indexfound < -1) { by } else { because java.lang.indexOf() return -1 when not found >-1 otherwise, < -1 does never occurs.