Android String Contain cutWords(String src, String contains)

Here you can find the source of cutWords(String src, String contains)

Description

cut Words

Declaration

public static String cutWords(String src, String contains) 

Method Source Code

//package com.java2s;

public class Main {
    public static String cutWords(String src, String contains) {
        int begin = src.indexOf(contains);
        if (begin == -1) {
            return src;
        }//from   ww  w  . j  a v  a 2 s  . c  o  m
        int end = begin + contains.length();
        String beginStr = "";
        if (begin != 0) {
            beginStr = src.substring(0, begin);
        }
        String endStr = "";
        if (end < src.length()) {
            endStr = src.substring(end);
        }
        return beginStr + endStr;
    }
}

Related

  1. contains(final CharSequence seq, final CharSequence searchSeq)
  2. containCount(String str, String searchStr)
  3. contains(String str, String searchStr)
  4. contains(String[] str, String searchStr)
  5. contains(String str, List keywords)
  6. cutWordsAll(String src, String contains)
  7. containsCharRef(String s)
  8. containsIgnoreCase(String str, String query)
  9. contains(String[] components, String value)