private CharSequence setSpanBetweenTokens(CharSequence text, String token,
      CharacterStyle... cs) {
    // Start and end refer to the points where the span will apply
    int tokenLen = token.length();
    int start = text.toString().indexOf(token) + tokenLen;
    int end = text.toString().indexOf(token, start);

    if (start > -1 && end > -1) {
      // Copy the spannable string to a mutable spannable string
      SpannableStringBuilder ssb = new SpannableStringBuilder(text);
      for (CharacterStyle c : cs)
        ssb.setSpan(c, start, end, 0);
      text = ssb;
    }
    return text;
  }
Given either a Spannable String or a regular String and a token, apply
the given CharacterStyle to the span between the tokens.

NOTE: This method was adapted from:
 http://www.androidengineer.com/2010/08/easy-method-for-formatting-android.html

<p>
For example, {@code setSpanBetweenTokens("Hello ##world##!", "##", new
ForegroundColorSpan(0xFFFF0000));} will return a CharSequence {@code
"Hello world!"} with {@code world} in red.
OCRTest/src/main/java/edu/sfsu/cs/orange/ocr/CaptureActivity.java