View Single Post
  #2 (permalink)  
Old 03-02-2008, 07:07 AM
roots's Avatar
roots roots is offline
Moderator
 
Join Date: Jan 2008
Location: Dallas
Posts: 263
roots is on a distinguished road
Code:
if (s.length() >= 3) { for (int i = 0; i < s.length() - 2; i++) { char c = s.charAt(i); String desired = "" + c + c + c; String actual = s.substring(i, i + 3); if (desired.equals(actual)) { // It matched .. System.out.println("True"); } } }
__________________
dont worry newbie, we got you covered.
Reply With Quote