Get slice of string
@param str string
@param start start index
@param end end index
@return new string
512381
public static String sliceOf( String str, int start, int end ) {
        return slc(str, start, end);
    }
860387
function __stringStartsWith(str, prefix) {
  // returns true for empty string or null prefix
  if ((!str)) return false;
  if (prefix == "" || prefix == null) return true;
  return str.indexOf(prefix, 0) === 0;
}
537425
function stringStartsWith (str, val, startIndex) {
  var rest = '' + str
  return (arguments.length === 1 ? rest : rest.substring(startIndex)).indexOf(val) === 0
}
551843
StringBuilder subBuf(int start, int end) {
		if (start > end) {
			return null;
		}
		StringBuilder ret = new StringBuilder(end - start + 1);
		for (int i=start; i<=end; i++) {
			ret.append(buf[i]);
		}
		return ret;
	}
1342971
public function slice(int $start=0, $end=null)
    {
        if ($end === null) {
            $end = $this->length();
        }
        if ($end > 0) {
            $end -= $start;
        } elseif ($end === 0) {
            return new Buffer([]);
        }
        $sliced = array_slice($this->data, $start, $end);
        return new Buffer($sliced);
    }
1193657
public static function betweenSubstr($string, $start, $end = null)
    {
        if (($start_pos = strpos($string, $start)) !== false) {
            if ($end) {
                if (($end_pos = strpos($string, $end, $start_pos + strlen($start))) !== false) {
                    return substr($string, $start_pos + strlen($start), $end_pos - ($start_pos + strlen($start)));
                }
            } else {
                return substr($string, $start_pos);
            }
        }
        return false;
    }
1144300
static private String[] getStringList( String str )
    {
        if ( str == null )
        {
            return null;
        }
        List<String> list = new ArrayList<>();
        int i = 0;
        int length = str.length();
        StringBuffer sb = null;
        while ( i < length )
        {
            char ch = str.charAt( i );
            if ( ch == ' ' )
            {
                // A space was hit. Add string to list
                if ( sb != null )
                {
                    list.add( sb.toString() );
                    sb = null;
                }
            }
            else if ( ch == '\\' )
            {
                // It is a delimiter. Add next character
                if ( i + 1 < length )
                {
                    ch = str.charAt( ++i );
                    if ( sb == null )
                    {
                        sb = new StringBuffer();
                    }
                    sb.append( ch );
                }
            }
            else
            {
                if ( sb == null )
                {
                    sb = new StringBuffer();
                }
                sb.append( ch );
            }
            i++; // Next character
        }
        // Make sure to add the last part to the list too
        if ( sb != null )
        {
            list.add( sb.toString() );
        }
        if ( list.size() == 0 )
        {
            return null;
        }
        String[] results = new String[list.size()];
        return list.toArray( results );
    }
1110331
function slice (ar, start, end) {
    return Array.prototype.slice.call(ar, start, end)
  }
708086
public static function slice($string, $start, $end = null, $encoding = null)
    {
        $encoding = $encoding === null ? mb_internal_encoding() : $encoding;

        if ($end === null) {
            $length = Mbstring::strlen($string, $encoding);
        } elseif ($end >= 0 && $end <= $start) {
            return '';
        } elseif ($end < 0) {
            $length = Mbstring::strlen($string, $encoding) + $end - $start;
        } else {
            $length = $end - $start;
        }

        return Mbstring::substr($string, $start, $length, $encoding);
    }
915532
protected StringBuffer slice_to(StringBuffer s)
    {
	slice_check();
	int len = ket - bra;
	s.replace(0, s.length(), current.substring(bra, ket));
	return s;
    }
594632
private function str_slice($str, $start = 0, $end = false)
    {
        if ($end !== FALSE && ($start < 0 || $end <= 0)) {
            $max = strlen($str);

            if ($start < 0) {
                if (($start = $max + $start) < 0) {
                    return '';
                }
            }

            if ($end < 0) {
                if (($end = $max + $end) < 0) {
                    return '';
                }
            }

            if ($end <= $start) {
                return '';
            }
        }

        $slice = ($end === FALSE) ? substr($str, $start) : substr($str, $start, $end - $start);

        return ($slice === FALSE) ? '' : $slice;
    }
1069035
private int find(UTF8String str, int start) {
    assert (str.numBytes > 0);
    while (start <= numBytes - str.numBytes) {
      if (ByteArrayMethods.arrayEquals(base, offset + start, str.base, str.offset, str.numBytes)) {
        return start;
      }
      start += 1;
    }
    return -1;
  }
1020906
private static byte[] extractBytes(
      String str, 
      int startIndex, 
      int endIndex,
      char[] charArray, 
      boolean canFastConvert) throws UnsupportedEncodingException {
    if (canFastConvert) {
      // fast conversion, just copy the raw bytes
      final int len = endIndex - startIndex;
      byte[] strBytes = new byte[len];
      for (int i = 0; i < len; i++) {
        strBytes[i] = (byte) charArray[startIndex + i];
      }
      return strBytes;
    } 
    // otherwise, do expensive conversion
    return str.substring(startIndex, endIndex).getBytes(utf8charsetName);
  }
284979
public static String substring( final String    str,
                                    final String    beginIndex )
    {
        return str.substring( Integer.valueOf( beginIndex ).intValue() );
    }
1154183
function(str, end) {
    return (str.length >= end.length &&
            str.substring(str.length - end.length) === end);
  }
1290779
public boolean endsWith(String str)
    {
        /* Let's just play this safe; should seldom if ever happen...
         * and because of that, can be sub-optimal, performancewise, to
         * alternatives.
         */
        if (mInputStart >= 0) {
            unshare(16);
        }

        int segIndex = (mSegments == null) ? 0 : mSegments.size();
        int inIndex = str.length() - 1;
        char[] buf = mCurrentSegment;
        int bufIndex = mCurrentSize-1;

        while (inIndex >= 0) {
            if (str.charAt(inIndex) != buf[bufIndex]) {
                return false;
            }
            if (--inIndex == 0) {
                break;
            }
            if (--bufIndex < 0) {
                if (--segIndex < 0) { // no more data?
                    return false;
                }
                buf = mSegments.get(segIndex);
                bufIndex = buf.length-1;
            }
        }

        return true;
    }
648338
public static String replace(String str, int start, int end, String rp) {
        if (str == null || start < 0 || start > end || end >= str.length()) {
            throw new IllegalArgumentException("参数非法");
        }

        return str.substring(0, start) + rp + str.substring(end + 1);
    }