/** Searches for the first index of the specified character. The search for the character starts at the beginning and moves * towards the end. * * @param string the string to find. * @return the index of the specified character, -1 if the character isn't found. * @see #lastIndexOf(String) * @since 1.4 */ public int indexOf (String string) { return indexOf(string, 0); }
public boolean contains (String subString) { return indexOf(subString, 0) != -1; }
/** Searches for the first index of the specified character. The search for the character starts at the beginning and moves * towards the end. * * @param string the string to find. * @return the index of the specified character, -1 if the character isn't found. * @see #lastIndexOf(String) * @since 1.4 */ public int indexOf (String string) { return indexOf(string, 0); }
public boolean contains (String subString) { return indexOf(subString, 0) != -1; }
/** Replaces all instances of {@code find} with {@code replace}. */ public StringBuilder replace (String find, String replace) { int findLength = find.length(), replaceLength = replace.length(); int index = 0; while (true) { index = indexOf(find, index); if (index == -1) break; replace0(index, index + findLength, replace); index += replaceLength; } return this; }
/** Replaces all instances of {@code find} with {@code replace}. */ public StringBuilder replace (String find, String replace) { int findLength = find.length(), replaceLength = replace.length(); int index = 0; while (true) { index = indexOf(find, index); if (index == -1) break; replace0(index, index + findLength, replace); index += replaceLength; } return this; }
public void actionPerformed (ActionEvent evt) { StringBuilder buffer = new StringBuilder(); buffer.append(NEHE_CHARS); buffer.append('\n'); int count = 0; for (int i = 33; i <= 255; i++) { if (buffer.indexOf(Character.toString((char)i)) != -1) continue; buffer.append((char)i); if (++count % 30 == 0) buffer.append('\n'); } sampleTextPane.setText(buffer.toString()); resetCacheButton.doClick(); } });
public void actionPerformed (ActionEvent evt) { StringBuilder buffer = new StringBuilder(); buffer.append(NEHE_CHARS); buffer.append('\n'); int count = 0; for (int i = 33; i <= 255; i++) { if (buffer.indexOf(Character.toString((char)i)) != -1) continue; buffer.append((char)i); if (++count % 30 == 0) buffer.append('\n'); } sampleTextPane.setText(buffer.toString()); resetCacheButton.doClick(); } });
if (wrap || text.indexOf("\n") != -1) {
if (wrap || text.indexOf("\n") != -1) {
/** Searches for the first index of the specified character. The search for the character starts at the beginning and moves * towards the end. * * @param string the string to find. * @return the index of the specified character, -1 if the character isn't found. * @see #lastIndexOf(String) * @since 1.4 */ public int indexOf (String string) { return indexOf(string, 0); }
/** Replaces all instances of {@code find} with {@code replace}. */ public StringBuilder replace (String find, String replace) { int findLength = find.length(), replaceLength = replace.length(); int index = 0; while (true) { index = indexOf(find, index); if (index == -1) break; replace0(index, index + findLength, replace); index += replaceLength; } return this; }
public void actionPerformed (ActionEvent evt) { StringBuilder buffer = new StringBuilder(); buffer.append(NEHE_CHARS); buffer.append('\n'); int count = 0; for (int i = 33; i <= 255; i++) { if (buffer.indexOf(Character.toString((char)i)) != -1) continue; buffer.append((char)i); if (++count % 30 == 0) buffer.append('\n'); } sampleTextPane.setText(buffer.toString()); resetCacheButton.doClick(); } });
if (wrap || text.indexOf("\n") != -1) {