Checks if a string's beginning and end are equal.

@param input The input string
@param beginTo The beginning string ends at this point.
@param endFrom The ending string starts from this point.
@return
True if the two parts are equals, otherwise false.
178121
private static boolean hasEqualParts(final String input,
                                       final int beginTo,
                                       final int endFrom) {
    String begin = input.substring(0, beginTo);
    String end = input.substring(endFrom);
    return begin.equals(end);
  }
638714
public static String insert(final String str, final String given, final int begin, final int end) {
    if (begin < 1 || end > str.length() || end < begin) { return str; }
    return str.substring(0, begin - 1) + given + str.substring(end);
  }
1115993
function isCharInRange(char = '', start, end) {
  if (isEmpty(char)) return false;
  const code = char.charCodeAt(0);
  return start <= code && code <= end;
}
592609
public boolean startsWith(CharSequence text)
    {
        try
        {
            if (text.length() == 0)
            {
                if (acceptEmpty)
                {
                    return true;
                }
                else
                {
                    throw new SyntaxErrorException("empty string not accepted");
                }
            }
            InputReader reader = Input.getInstance(text);
            return startsWith(reader);
        }
        catch (IOException ex)
        {
            throw new IllegalArgumentException("can't happen");
        }
    }
518788
@Override
    public boolean endsWith(final Path other) {
        // Precondition checks
        if (other == null) {
            throw new IllegalArgumentException("other path must be specified");
        }
        // Unequal FS? (also ensures that we can safely cast to this type later)
        if (this.getFileSystem() != other.getFileSystem()) {
            return false;
        }
        final List<String> ourTokens = tokenize(this);
        final List<String> otherTokens = tokenize((ShrinkWrapPath) other);

        // Bigger than us, fails
        final int numOtherTokens = otherTokens.size();
        if (numOtherTokens > ourTokens.size()) {
            return false;
        }

        // Difference in component size
        final int differential = ourTokens.size() - numOtherTokens;
        // Given an absolute?
        if (other.isAbsolute()) {
            // We must have the same number of elements
            if (differential != 0) {
                return false;
            }
        }
        // Compare all components
        for (int i = numOtherTokens - 1; i >= 0; i--) {
            if (!ourTokens.get(i + differential).equals(otherTokens.get(i))) {
                // Any tokens don't match, punt
                return false;
            }
        }

        // All conditions met
        return true;
    }
251642
static boolean checkWildCards(final SearchableString value, final Literal[] suffixes, final int start,
            final int end) {

        if (suffixes == null) {
            // No wildcards
            return start == end + 1;
        }

        // One wildcard
        if (suffixes.length == 0) {
            return start <= end + 1;
        }

        int from = start;
        for (final Literal suffix : suffixes) {

            final int match = checkWildCard(value, suffix, from);
            if (match == -1) {
                return false;
            }

            from = suffix.getLength() + match;
            if (from > end + 1) {
                return false;
            }
        }

        return true;
    }
302308
function endsWith(testStr, endsStr) {
        var index = testStr.lastIndexOf(endsStr);
        if (index < 0) {
            return false;
        }
        if (endsStr.length + index == testStr.length) {
            return true;
        }
        return false;
    }
1267090
public static boolean endsWithIgnoreCase(final String base, final String end) {
	if (base.length() < end.length()) {
	    return false;
	}
	return base.regionMatches(true, base.length() - end.length(), end, 0, end.length());
    }
268196
private boolean isEqual(String str1, String str2) {
		if (StringUtils.isEmpty(str1) && StringUtils.isEmpty(str2)) {
			return true;
		} else if (!StringUtils.isEmpty(str1)) {
			return str1.equals(str2);
		} else {
			return false;
		}
	}
1220147
public static int findFirstOf(String string, String chars, int start, int end) {
        for (int i = start; i < end; i++) {
            char c = string.charAt(i);
            if (chars.indexOf(c) != -1) {
                return i;
            }
        }
        return end;
    }
1343101
public static boolean isDigit(String str, int beginIndex, int endIndex)
    {
        char c;
        for ( int j = beginIndex; j < endIndex; j++ ) {
            c = str.charAt(j);
            //make full-width char half-width
            if ( c > 65280 ) c -= 65248;
            if ( c < 48 || c > 57 ) {
                return false;
            }
        }

        return true;
    }
960324
public static boolean endsWithStop(String str) {
	if (str.endsWith(".") || str.endsWith("?") || str.endsWith("!")) {
	    return true;
	}
	
	return false;
    }
931482
def endswith(self, suffix, start=None, end=None):
        
        suffix = Bits(suffix)
        start, end = self._validate_slice(start, end)
        if start + suffix.len > end:
            return False
        start = end - suffix.len
        return self._slice(start, end) == suffix
1174269
private static boolean endsWith(byte[] subject, byte[] suffix) {
    int start = subject.length - suffix.length;
    if (start < 0) {
      return false;
    }
    for (int i = start; i < subject.length; i++) {
      if (subject[i] != suffix[i - start]) {
        return false;
      }
    }
    return true;
  }
1319825
public void initialize(CharSequence input, int begin, int end) {
    this.input = input;
    this.send = end;
    this.matcher.reset(input).region(begin, end);
    this.index = begin;
    advance();
  }
324281
public static boolean endsWithIgnoreCase(String str, String suffix) {
        if (str == null || suffix == null)
            return false;

        int strLength = str.length();
        int suffixLength = suffix.length();

        // return false if the string is smaller than the suffix.
        if (strLength < suffixLength)
            return false;

        // perform regionMatch with ignorecase
        if (str.regionMatches(true, strLength - suffixLength, suffix, 0, suffixLength))
            return true;

        return false;
    }
683625
public boolean contains(long start, long end) {
        assert start <= end;
        return end <= getSafePoint() || m_map.encloses(range(start, end));
    }