Example usage for org.apache.wicket.util.string Strings indexOf

List of usage examples for org.apache.wicket.util.string Strings indexOf

Introduction

In this page you can find the example usage for org.apache.wicket.util.string Strings indexOf.

Prototype

public static int indexOf(final CharSequence sequence, final char ch) 

Source Link

Document

returns the zero-based index of a character within a char sequence.

Usage

From source file:jp.javelindev.wicket.ajaxlist.SimpleResponse.java

License:Apache License

/**
 * //www. jav a2 s.  c  o  m
 * @param str
 * @return true if string needs to be encoded, false otherwise
 */
protected boolean needsEncoding(CharSequence str) {
    /*
     * TODO Post 1.2: Ajax: we can improve this by keeping a buffer of at least 3 characters and
     * checking that buffer so that we can narrow down escaping occurring only for ']]>'
     * sequence, or at least for ]] if ] is the last char in this buffer.
     * 
     * but this improvement will only work if we write first and encode later instead of working
     * on fragments sent to write
     */
    return Strings.indexOf(str, ']') >= 0;
}