Tabnine Logo
String.startEndAndLength
Code IndexAdd Tabnine to your IDE (free)

How to use
startEndAndLength
method
in
java.lang.String

Best Java code snippets using java.lang.String.startEndAndLength (Showing top 20 results out of 315)

origin: robovm/robovm

/**
 * Copies the specified characters in this string to the character array
 * starting at the specified offset in the character array.
 *
 * @param start
 *            the starting offset of characters to copy.
 * @param end
 *            the ending offset of characters to copy.
 * @param buffer
 *            the destination character array.
 * @param index
 *            the starting offset in the character array.
 * @throws NullPointerException
 *             if {@code buffer} is {@code null}.
 * @throws IndexOutOfBoundsException
 *             if {@code start < 0}, {@code end > length()}, {@code start >
 *             end}, {@code index < 0}, {@code end - start > buffer.length -
 *             index}
 */
public void getChars(int start, int end, char[] buffer, int index) {
  // Note: last character not copied!
  if (start >= 0 && start <= end && end <= count) {
    System.arraycopy(value, start + offset, buffer, index, end - start);
  } else {
    // We throw StringIndexOutOfBoundsException rather than System.arraycopy's AIOOBE.
    throw startEndAndLength(start, end);
  }
}
origin: robovm/robovm

/**
 * Returns a string containing a subsequence of characters from this string.
 * The returned string shares this string's <a href="#backing_array">backing
 * array</a>.
 *
 * @param start
 *            the offset of the first character.
 * @param end
 *            the offset one past the last character.
 * @return a new string containing the characters from start to end - 1
 * @throws IndexOutOfBoundsException
 *             if {@code start < 0}, {@code start > end} or {@code end >
 *             length()}.
 */
public String substring(int start, int end) {
  if (start == 0 && end == count) {
    return this;
  }
  // NOTE last character not copied!
  // Fast range check.
  if (start >= 0 && start <= end && end <= count) {
    return new String(offset + start, end - start, value);
  }
  throw startEndAndLength(start, end);
}
origin: robovm/robovm

/**
 * Calculates the number of Unicode code points between {@code start}
 * and {@code end}.
 *
 * @param start
 *            the inclusive beginning index of the subsequence.
 * @param end
 *            the exclusive end index of the subsequence.
 * @return the number of Unicode code points in the subsequence.
 * @throws IndexOutOfBoundsException
 *         if {@code start < 0 || end > length() || start > end}
 * @see Character#codePointCount(CharSequence, int, int)
 * @since 1.5
 */
public int codePointCount(int start, int end) {
  if (start < 0 || end > count || start > end) {
    throw startEndAndLength(start, end);
  }
  return Character.codePointCount(value, offset + start, end - start);
}
origin: robovm/robovm

throw startEndAndLength(start, end);
origin: com.mobidevelop.robovm/robovm-rt

/**
 * Returns a string containing a subsequence of characters from this string.
 * The returned string shares this string's <a href="#backing_array">backing
 * array</a>.
 *
 * @param start
 *            the offset of the first character.
 * @param end
 *            the offset one past the last character.
 * @return a new string containing the characters from start to end - 1
 * @throws IndexOutOfBoundsException
 *             if {@code start < 0}, {@code start > end} or {@code end >
 *             length()}.
 */
public String substring(int start, int end) {
  if (start == 0 && end == count) {
    return this;
  }
  // NOTE last character not copied!
  // Fast range check.
  if (start >= 0 && start <= end && end <= count) {
    return new String(offset + start, end - start, value);
  }
  throw startEndAndLength(start, end);
}
origin: com.bugvm/bugvm-rt

/**
 * Returns a string containing a subsequence of characters from this string.
 * The returned string shares this string's <a href="#backing_array">backing
 * array</a>.
 *
 * @param start
 *            the offset of the first character.
 * @param end
 *            the offset one past the last character.
 * @return a new string containing the characters from start to end - 1
 * @throws IndexOutOfBoundsException
 *             if {@code start < 0}, {@code start > end} or {@code end >
 *             length()}.
 */
public String substring(int start, int end) {
  if (start == 0 && end == count) {
    return this;
  }
  // NOTE last character not copied!
  // Fast range check.
  if (start >= 0 && start <= end && end <= count) {
    return new String(offset + start, end - start, value);
  }
  throw startEndAndLength(start, end);
}
origin: ibinti/bugvm

/**
 * Returns a string containing a subsequence of characters from this string.
 * The returned string shares this string's <a href="#backing_array">backing
 * array</a>.
 *
 * @param start
 *            the offset of the first character.
 * @param end
 *            the offset one past the last character.
 * @return a new string containing the characters from start to end - 1
 * @throws IndexOutOfBoundsException
 *             if {@code start < 0}, {@code start > end} or {@code end >
 *             length()}.
 */
public String substring(int start, int end) {
  if (start == 0 && end == count) {
    return this;
  }
  // NOTE last character not copied!
  // Fast range check.
  if (start >= 0 && start <= end && end <= count) {
    return new String(offset + start, end - start, value);
  }
  throw startEndAndLength(start, end);
}
origin: MobiVM/robovm

/**
 * Returns a string containing a subsequence of characters from this string.
 * The returned string shares this string's <a href="#backing_array">backing
 * array</a>.
 *
 * @param start
 *            the offset of the first character.
 * @param end
 *            the offset one past the last character.
 * @return a new string containing the characters from start to end - 1
 * @throws IndexOutOfBoundsException
 *             if {@code start < 0}, {@code start > end} or {@code end >
 *             length()}.
 */
public String substring(int start, int end) {
  if (start == 0 && end == count) {
    return this;
  }
  // NOTE last character not copied!
  // Fast range check.
  if (start >= 0 && start <= end && end <= count) {
    return new String(offset + start, end - start, value);
  }
  throw startEndAndLength(start, end);
}
origin: ibinti/bugvm

/**
 * Copies the specified characters in this string to the character array
 * starting at the specified offset in the character array.
 *
 * @param start
 *            the starting offset of characters to copy.
 * @param end
 *            the ending offset of characters to copy.
 * @param buffer
 *            the destination character array.
 * @param index
 *            the starting offset in the character array.
 * @throws NullPointerException
 *             if {@code buffer} is {@code null}.
 * @throws IndexOutOfBoundsException
 *             if {@code start < 0}, {@code end > length()}, {@code start >
 *             end}, {@code index < 0}, {@code end - start > buffer.length -
 *             index}
 */
public void getChars(int start, int end, char[] buffer, int index) {
  // Note: last character not copied!
  if (start >= 0 && start <= end && end <= count) {
    System.arraycopy(value, start + offset, buffer, index, end - start);
  } else {
    // We throw StringIndexOutOfBoundsException rather than System.arraycopy's AIOOBE.
    throw startEndAndLength(start, end);
  }
}
origin: com.gluonhq/robovm-rt

/**
 * Returns a string containing a subsequence of characters from this string.
 * The returned string shares this string's <a href="#backing_array">backing
 * array</a>.
 *
 * @param start
 *            the offset of the first character.
 * @param end
 *            the offset one past the last character.
 * @return a new string containing the characters from start to end - 1
 * @throws IndexOutOfBoundsException
 *             if {@code start < 0}, {@code start > end} or {@code end >
 *             length()}.
 */
public String substring(int start, int end) {
  if (start == 0 && end == count) {
    return this;
  }
  // NOTE last character not copied!
  // Fast range check.
  if (start >= 0 && start <= end && end <= count) {
    return new String(offset + start, end - start, value);
  }
  throw startEndAndLength(start, end);
}
origin: MobiVM/robovm

/**
 * Copies the specified characters in this string to the character array
 * starting at the specified offset in the character array.
 *
 * @param start
 *            the starting offset of characters to copy.
 * @param end
 *            the ending offset of characters to copy.
 * @param buffer
 *            the destination character array.
 * @param index
 *            the starting offset in the character array.
 * @throws NullPointerException
 *             if {@code buffer} is {@code null}.
 * @throws IndexOutOfBoundsException
 *             if {@code start < 0}, {@code end > length()}, {@code start >
 *             end}, {@code index < 0}, {@code end - start > buffer.length -
 *             index}
 */
public void getChars(int start, int end, char[] buffer, int index) {
  // Note: last character not copied!
  if (start >= 0 && start <= end && end <= count) {
    System.arraycopy(value, start + offset, buffer, index, end - start);
  } else {
    // We throw StringIndexOutOfBoundsException rather than System.arraycopy's AIOOBE.
    throw startEndAndLength(start, end);
  }
}
origin: com.bugvm/bugvm-rt

/**
 * Copies the specified characters in this string to the character array
 * starting at the specified offset in the character array.
 *
 * @param start
 *            the starting offset of characters to copy.
 * @param end
 *            the ending offset of characters to copy.
 * @param buffer
 *            the destination character array.
 * @param index
 *            the starting offset in the character array.
 * @throws NullPointerException
 *             if {@code buffer} is {@code null}.
 * @throws IndexOutOfBoundsException
 *             if {@code start < 0}, {@code end > length()}, {@code start >
 *             end}, {@code index < 0}, {@code end - start > buffer.length -
 *             index}
 */
public void getChars(int start, int end, char[] buffer, int index) {
  // Note: last character not copied!
  if (start >= 0 && start <= end && end <= count) {
    System.arraycopy(value, start + offset, buffer, index, end - start);
  } else {
    // We throw StringIndexOutOfBoundsException rather than System.arraycopy's AIOOBE.
    throw startEndAndLength(start, end);
  }
}
origin: FlexoVM/flexovm

/**
 * Returns a string containing a subsequence of characters from this string.
 * The returned string shares this string's <a href="#backing_array">backing
 * array</a>.
 *
 * @param start
 *            the offset of the first character.
 * @param end
 *            the offset one past the last character.
 * @return a new string containing the characters from start to end - 1
 * @throws IndexOutOfBoundsException
 *             if {@code start < 0}, {@code start > end} or {@code end >
 *             length()}.
 */
public String substring(int start, int end) {
  if (start == 0 && end == count) {
    return this;
  }
  // NOTE last character not copied!
  // Fast range check.
  if (start >= 0 && start <= end && end <= count) {
    return new String(offset + start, end - start, value);
  }
  throw startEndAndLength(start, end);
}
origin: com.mobidevelop.robovm/robovm-rt

/**
 * Copies the specified characters in this string to the character array
 * starting at the specified offset in the character array.
 *
 * @param start
 *            the starting offset of characters to copy.
 * @param end
 *            the ending offset of characters to copy.
 * @param buffer
 *            the destination character array.
 * @param index
 *            the starting offset in the character array.
 * @throws NullPointerException
 *             if {@code buffer} is {@code null}.
 * @throws IndexOutOfBoundsException
 *             if {@code start < 0}, {@code end > length()}, {@code start >
 *             end}, {@code index < 0}, {@code end - start > buffer.length -
 *             index}
 */
public void getChars(int start, int end, char[] buffer, int index) {
  // Note: last character not copied!
  if (start >= 0 && start <= end && end <= count) {
    System.arraycopy(value, start + offset, buffer, index, end - start);
  } else {
    // We throw StringIndexOutOfBoundsException rather than System.arraycopy's AIOOBE.
    throw startEndAndLength(start, end);
  }
}
origin: com.bugvm/bugvm-rt

/**
 * Calculates the number of Unicode code points between {@code start}
 * and {@code end}.
 *
 * @param start
 *            the inclusive beginning index of the subsequence.
 * @param end
 *            the exclusive end index of the subsequence.
 * @return the number of Unicode code points in the subsequence.
 * @throws IndexOutOfBoundsException
 *         if {@code start < 0 || end > length() || start > end}
 * @see Character#codePointCount(CharSequence, int, int)
 * @since 1.5
 */
public int codePointCount(int start, int end) {
  if (start < 0 || end > count || start > end) {
    throw startEndAndLength(start, end);
  }
  return Character.codePointCount(value, offset + start, end - start);
}
origin: FlexoVM/flexovm

/**
 * Calculates the number of Unicode code points between {@code start}
 * and {@code end}.
 *
 * @param start
 *            the inclusive beginning index of the subsequence.
 * @param end
 *            the exclusive end index of the subsequence.
 * @return the number of Unicode code points in the subsequence.
 * @throws IndexOutOfBoundsException
 *         if {@code start < 0 || end > length() || start > end}
 * @see Character#codePointCount(CharSequence, int, int)
 * @since 1.5
 */
public int codePointCount(int start, int end) {
  if (start < 0 || end > count || start > end) {
    throw startEndAndLength(start, end);
  }
  return Character.codePointCount(value, offset + start, end - start);
}
origin: com.mobidevelop.robovm/robovm-rt

/**
 * Calculates the number of Unicode code points between {@code start}
 * and {@code end}.
 *
 * @param start
 *            the inclusive beginning index of the subsequence.
 * @param end
 *            the exclusive end index of the subsequence.
 * @return the number of Unicode code points in the subsequence.
 * @throws IndexOutOfBoundsException
 *         if {@code start < 0 || end > length() || start > end}
 * @see Character#codePointCount(CharSequence, int, int)
 * @since 1.5
 */
public int codePointCount(int start, int end) {
  if (start < 0 || end > count || start > end) {
    throw startEndAndLength(start, end);
  }
  return Character.codePointCount(value, offset + start, end - start);
}
origin: MobiVM/robovm

/**
 * Calculates the number of Unicode code points between {@code start}
 * and {@code end}.
 *
 * @param start
 *            the inclusive beginning index of the subsequence.
 * @param end
 *            the exclusive end index of the subsequence.
 * @return the number of Unicode code points in the subsequence.
 * @throws IndexOutOfBoundsException
 *         if {@code start < 0 || end > length() || start > end}
 * @see Character#codePointCount(CharSequence, int, int)
 * @since 1.5
 */
public int codePointCount(int start, int end) {
  if (start < 0 || end > count || start > end) {
    throw startEndAndLength(start, end);
  }
  return Character.codePointCount(value, offset + start, end - start);
}
origin: ibinti/bugvm

/**
 * Calculates the number of Unicode code points between {@code start}
 * and {@code end}.
 *
 * @param start
 *            the inclusive beginning index of the subsequence.
 * @param end
 *            the exclusive end index of the subsequence.
 * @return the number of Unicode code points in the subsequence.
 * @throws IndexOutOfBoundsException
 *         if {@code start < 0 || end > length() || start > end}
 * @see Character#codePointCount(CharSequence, int, int)
 * @since 1.5
 */
public int codePointCount(int start, int end) {
  if (start < 0 || end > count || start > end) {
    throw startEndAndLength(start, end);
  }
  return Character.codePointCount(value, offset + start, end - start);
}
origin: com.gluonhq/robovm-rt

/**
 * Calculates the number of Unicode code points between {@code start}
 * and {@code end}.
 *
 * @param start
 *            the inclusive beginning index of the subsequence.
 * @param end
 *            the exclusive end index of the subsequence.
 * @return the number of Unicode code points in the subsequence.
 * @throws IndexOutOfBoundsException
 *         if {@code start < 0 || end > length() || start > end}
 * @see Character#codePointCount(CharSequence, int, int)
 * @since 1.5
 */
public int codePointCount(int start, int end) {
  if (start < 0 || end > count || start > end) {
    throw startEndAndLength(start, end);
  }
  return Character.codePointCount(value, offset + start, end - start);
}
java.langStringstartEndAndLength

Popular methods of String

  • equals
  • length
    Returns the number of characters in this string.
  • substring
    Returns a string containing a subsequence of characters from this string. The returned string shares
  • startsWith
    Compares the specified string to this string, starting at the specified offset, to determine if the
  • format
    Returns a formatted string, using the supplied format and arguments, localized to the given locale.
  • split
    Splits this string using the supplied regularExpression. See Pattern#split(CharSequence,int) for an
  • trim
  • valueOf
    Creates a new string containing the specified characters in the character array. Modifying the chara
  • indexOf
  • endsWith
    Compares the specified string to this string to determine if the specified string is a suffix.
  • toLowerCase
    Converts this string to lower case, using the rules of locale.Most case mappings are unaffected by t
  • contains
    Determines if this String contains the sequence of characters in the CharSequence passed.
  • toLowerCase,
  • contains,
  • getBytes,
  • <init>,
  • equalsIgnoreCase,
  • replace,
  • isEmpty,
  • charAt,
  • hashCode,
  • lastIndexOf

Popular in Java

  • Making http requests using okhttp
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getResourceAsStream (ClassLoader)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Socket (java.net)
    Provides a client-side TCP socket.
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now