Deidentify middle.

@param str the str
@param start the start
@param end the end
@return the string

@since 2.0.0
962559
public static String deidentifyMiddle(String str, int start, int end) {

		int repeat;
		if (end - start > str.length()) {
			repeat = str.length();
		} else {
			repeat = (str.length()- end) - start;
		}
		return StringUtils.overlay(str, StringUtils.repeat('*', repeat), start, str.length()-end);
	}
567478
public BooleanExpression endsWith(Expression<String> str) {
        return Expressions.booleanOperation(Ops.ENDS_WITH, mixin, str);
    }
1076549
public function getStringsBetween($string, $start, $end)
    {
        $lastPos   = 0;
        $positions = array();

        while (($lastPos = strpos($string, $start, $lastPos)) !== false) {
            $positions[] = $lastPos;
            $lastPos     += strlen($start);
        }
        $lastPos      = 0;
        $positionsEnd = array();
        while (($lastPos      = strpos($string, $end, $lastPos)) !== false) {
            $positionsEnd[] = $lastPos;
            $lastPos        += strlen($end);
        }
        $return = [];
        foreach ($positions as $index => $position) {
            $return[] = str_replace([$start, $end], '', substr($string, $position, $positionsEnd[$index] - $position));
        }
        return $return;
    }
1009690
public static function between(
        $string,
        $start,
        $end,
        $offset = 0,
        $encoding = null
    ) {
        $encoding = $encoding === null ? mb_internal_encoding() : $encoding;

        $startIndex = Mbstring::strpos($string, $start, $offset, $encoding);

        if ($startIndex === false) {
            return '';
        }

        $substrIndex = $startIndex + Mbstring::strlen($start, $encoding);

        $endIndex = Mbstring::strpos($string, $end, $substrIndex, $encoding);

        if ($endIndex === false) {
            return '';
        }

        return Mbstring::substr($string, $substrIndex, $endIndex - $substrIndex);
    }
1089280
public NumberExpression<Integer> locate(String str, Expression<Integer> start) {
        return Expressions.numberOperation(Integer.class, Ops.StringOps.LOCATE2, ConstantImpl.create(str), mixin, start);
    }
434283
protected final String shaveOffNonJavaIdentifierStartChars( String str ) {
      String str2 = str;
      // shave off first char if not valid
      boolean ready = false;
      while( !ready ){
         if( !Character.isJavaIdentifierStart( str2.charAt( 0 ) ) ){
            str2 = str2.substring( 1 );
            if( str2.length() == 0 ){
               throw new JSONException( "Can't convert '" + str + "' to a valid Java identifier" );
            }
         }else{
            ready = true;
         }
      }
      return str2;
   }
1075206
public List<String> getStringEnclosedIn(String srcStr, String startToken, String endToken) {
        List<StrPosition> resultList = getStringEnclosedInWithDetails(srcStr, startToken, endToken);
        List<String> retList = new ArrayList<String>();
        for (StrPosition sp : resultList) {
            retList.add(sp.str);
        }
        return retList;
    }
674241
public static int endsWith(String str, String[] arr)
    {
        if ( arr == null ) {
            return -1;
        }
        
        for ( int i = 0; i < arr.length; i++ ) {
            if ( arr[i].endsWith(str) ) {
                return i;
            }
        }
        
        return -1;
    }
962761
public String substring(int start, int end) {
        char[] buf = new char[end - start];
        getChars(start, end, buf, 0);
        return new String(buf);
    }
1374323
public static String initials(final String str) {
		if (str == null) {
			return "";
		}
		StringBuilder sb = new StringBuilder();
		Pattern p = Pattern.compile("^\\w|\\s+\\w");
		Matcher m = p.matcher(decode(str));
		while (m.find()) {
			sb.append(m.group().replaceAll(" ", ""));
		}
		return sb.toString();
	}
915617
public String substringBetween(String string, String begin, String end, boolean includeBoundaries) {
		if (string == null || begin == null || end == null) {
			return null;
		}
		int startPos = string.indexOf(begin);
		if (startPos != -1) {
			if (includeBoundaries)
				startPos = startPos - begin.length();
			int endPos = string.lastIndexOf(end);
			if (endPos != -1) {
				if (includeBoundaries)
					endPos = endPos + end.length();
				return string.substring(startPos + begin.length(), endPos);
			}
		}
		return null;
	}
1150133
public static String dequote(String str) {
        char start = str.charAt(0);
        if ((start == '\'') || (start == '\"')) {
            // possibly quoted
            char end = str.charAt(str.length() - 1);
            if (start == end) {
                // dequote
                return str.substring(1, str.length() - 1);
            }
        }
        return str;
    }
482995
public static long parseLongBase10(final CharSequence str, final int start, final int end) {
    // Current position and character.
    int pos = start;
    char cur = str.charAt(pos);

    // Match sign
    boolean isNegative = (cur == '-');
    // Carefully consume the - character, update c and i:
    if((isNegative || (cur == '+')) && (++pos < end)) {
      cur = str.charAt(pos);
    }

    // Begin parsing real numbers!
    if((cur < '0') || (cur > '9')) {
      throw NOT_A_NUMBER;
    }

    // Parse digits into a long, remember offset of decimal point.
    long decimal = 0;
    while(true) {
      final int digit = cur - '0';
      if((digit >= 0) && (digit <= 9)) {
        final long tmp = (decimal << 3) + (decimal << 1) + digit;
        if(tmp < decimal) {
          throw PRECISION_OVERFLOW;
        }
        decimal = tmp;
      }
      else { // No more digits, or a second dot.
        break;
      }
      if(++pos < end) {
        cur = str.charAt(pos);
      }
      else {
        break;
      }
    }
    if(pos != end) {
      throw TRAILING_CHARACTERS;
    }

    return isNegative ? -decimal : decimal;
  }
304706
public HashSet<String> getStringsStartingWith(String prefixStr)
    {
        HashSet<String> strHashSet = new HashSet<String>();

        if (sourceNode != null)      //if the MDAG hasn't been simplified
        {
            MDAGNode originNode = sourceNode.transition(prefixStr);  //attempt to _transition down the path denoted by prefixStr

            if (originNode != null) //if there a _transition path corresponding to prefixString (one or more stored Strings begin with prefixString)
            {
                if (originNode.isAcceptNode()) strHashSet.add(prefixStr);
                getStrings(strHashSet, SearchCondition.PREFIX_SEARCH_CONDITION, prefixStr, prefixStr, originNode.getOutgoingTransitions());   //retrieve all Strings that extend the _transition path denoted by prefixStr
            }
        }
        else
        {
            SimpleMDAGNode originNode = SimpleMDAGNode.traverseMDAG(mdagDataArray, simplifiedSourceNode, prefixStr);      //attempt to _transition down the path denoted by prefixStr

            if (originNode != null)      //if there a _transition path corresponding to prefixString (one or more stored Strings begin with prefixStr)
            {
                if (originNode.isAcceptNode()) strHashSet.add(prefixStr);
                getStrings(strHashSet, SearchCondition.PREFIX_SEARCH_CONDITION, prefixStr, prefixStr, originNode);        //retrieve all Strings that extend the _transition path denoted by prefixString
            }
        }

        return strHashSet;
    }
1130520
public static function match(string $str, string $start, string $end) {
		$start = preg_quote($start);
		$end = preg_quote($end);
		if (preg_match('/' . $start . '(.*)' . $end . '/', $str, $matches)) {
			return $matches[1] . '';
		}
		return false;
	}
108480
public static function hideString($string, $start, $end, $replace = "*")
    {
        $length = strlen($string);
        $result = '';

        if ($start >= $length) {
            return $result;
        }
        if ($end <= $start) {
            return $result;
        }

        for ($i = 0; $i < $length; $i++) {
            $result .= $i >= $start && $i <= $end ? $replace : $string[$i];
        }
        return $result;
    }
669846
public boolean endsWith(final String str) {
        if (str == null) {
            return false;
        }
        final int len = str.length();
        if (len == 0) {
            return true;
        }
        if (len > size) {
            return false;
        }
        int pos = size - len;
        for (int i = 0; i < len; i++,pos++) {
            if (buffer[pos] != str.charAt(i)) {
                return false;
            }
        }
        return true;
    }