boolean (final String docString) { boolean hasExample = false; StringTokenizer tokenizer = new StringTokenizer(docString, "\n"); while (tokenizer.hasMoreTokens()) { String str = tokenizer.nextToken().trim(); if (str.startsWith(">>>")) { hasExample = true; break; } } return hasExample; }