Android String Cut cutStringFromChar(String str1, String str2, int offset)

Here you can find the source of cutStringFromChar(String str1, String str2, int offset)

Description

cut String From Char

Declaration

public static String cutStringFromChar(String str1, String str2,
        int offset) 

Method Source Code

//package com.java2s;

public class Main {

    public static String cutStringFromChar(String str1, String str2,
            int offset) {
        if (isEmpty(str1)) {
            return "";
        }//from w  ww  .  j  av a2 s.c om
        int start = str1.indexOf(str2);
        if (start != -1) {
            if (str1.length() > start + offset) {
                return str1.substring(start + offset);
            }
        }
        return "";
    }

    public static boolean isEmpty(String str) {
        return str == null || str.trim().length() == 0;
    }
}

Related

  1. cutText(String text, int maxLength)
  2. safeCut(String str, int length)
  3. safeCutNoDot(String str, int length)
  4. cutString(String str, int length)
  5. cutString(String str, int length, String dot)
  6. cutRight(final String srcStr, final String cutStr)
  7. cutoff(String value, int length)
  8. cutString(String str, int length)
  9. cutString(String str, int length, String dot)