java.lang.StringBuilder.insert0()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(11.5k)|赞(0)|评价(0)|浏览(170)

本文整理了Java中java.lang.StringBuilder.insert0()方法的一些代码示例,展示了StringBuilder.insert0()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。StringBuilder.insert0()方法的具体详情如下:
包路径:java.lang.StringBuilder
类名称:StringBuilder
方法名:insert0

StringBuilder.insert0介绍

暂无

代码示例

代码示例来源:origin: robovm/robovm

/**
 * Inserts the specified string at the specified {@code offset}. If the
 * specified string is null, then the String {@code "null"} is inserted.
 *
 * @param offset
 *            the index to insert at.
 * @param str
 *            the {@code String} to insert.
 * @return this builder.
 * @throws StringIndexOutOfBoundsException
 *             if {@code offset} is negative or greater than the current
 *             {@code length()}.
 */
public StringBuilder insert(int offset, String str) {
  insert0(offset, str);
  return this;
}

代码示例来源:origin: robovm/robovm

/**
 * Inserts the string representation of the specified {@code char[]} at the
 * specified {@code offset}. The {@code char[]} value is converted to a
 * String according to the rule defined by {@link String#valueOf(char[])}.
 *
 * @param offset
 *            the index to insert at.
 * @param ch
 *            the {@code char[]} to insert.
 * @return this builder.
 * @throws StringIndexOutOfBoundsException
 *             if {@code offset} is negative or greater than the current
 *             {@code length()}.
 * @see String#valueOf(char[])
 */
public StringBuilder insert(int offset, char[] ch) {
  insert0(offset, ch);
  return this;
}

代码示例来源:origin: robovm/robovm

/**
 * Inserts the string representation of the specified {@code char} value at
 * the specified {@code offset}. The {@code char} value is converted to a
 * string according to the rule defined by {@link String#valueOf(char)}.
 *
 * @param offset
 *            the index to insert at.
 * @param c
 *            the {@code char} value to insert.
 * @return this builder.
 * @throws IndexOutOfBoundsException
 *             if {@code offset} is negative or greater than the current
 *             {@code length()}.
 * @see String#valueOf(char)
 */
public StringBuilder insert(int offset, char c) {
  insert0(offset, c);
  return this;
}

代码示例来源:origin: robovm/robovm

/**
 * Inserts the string representation of the specified {@code boolean} value
 * at the specified {@code offset}. The {@code boolean} value is converted
 * to a string according to the rule defined by
 * {@link String#valueOf(boolean)}.
 *
 * @param offset
 *            the index to insert at.
 * @param b
 *            the {@code boolean} value to insert.
 * @return this builder.
 * @throws StringIndexOutOfBoundsException
 *             if {@code offset} is negative or greater than the current
 *             {@code length}.
 * @see String#valueOf(boolean)
 */
public StringBuilder insert(int offset, boolean b) {
  insert0(offset, b ? "true" : "false");
  return this;
}

代码示例来源:origin: robovm/robovm

/**
 * Inserts the string representation of the specified subsequence of the
 * {@code char[]} at the specified {@code offset}. The {@code char[]} value
 * is converted to a String according to the rule defined by
 * {@link String#valueOf(char[],int,int)}.
 *
 * @param offset
 *            the index to insert at.
 * @param str
 *            the {@code char[]} to insert.
 * @param strOffset
 *            the inclusive index.
 * @param strLen
 *            the number of characters.
 * @return this builder.
 * @throws StringIndexOutOfBoundsException
 *             if {@code offset} is negative or greater than the current
 *             {@code length()}, or {@code strOffset} and {@code strLen} do
 *             not specify a valid subsequence.
 * @see String#valueOf(char[],int,int)
 */
public StringBuilder insert(int offset, char[] str, int strOffset,
    int strLen) {
  insert0(offset, str, strOffset, strLen);
  return this;
}

代码示例来源:origin: robovm/robovm

/**
 * Inserts the string representation of the specified subsequence of the
 * {@code CharSequence} at the specified {@code offset}. The {@code
 * CharSequence} is converted to a String as defined by
 * {@link CharSequence#subSequence(int, int)}. If the {@code CharSequence}
 * is {@code null}, then the string {@code "null"} is used to determine the
 * subsequence.
 *
 * @param offset
 *            the index to insert at.
 * @param s
 *            the {@code CharSequence} to insert.
 * @param start
 *            the start of the subsequence of the character sequence.
 * @param end
 *            the end of the subsequence of the character sequence.
 * @return this builder.
 * @throws IndexOutOfBoundsException
 *             if {@code offset} is negative or greater than the current
 *             {@code length()}, or {@code start} and {@code end} do not
 *             specify a valid subsequence.
 * @see CharSequence#subSequence(int, int)
 */
public StringBuilder insert(int offset, CharSequence s, int start, int end) {
  insert0(offset, s, start, end);
  return this;
}

代码示例来源:origin: robovm/robovm

/**
 * Inserts the string representation of the specified {@code float} value at
 * the specified {@code offset}. The {@code float} value is converted to a
 * string according to the rule defined by {@link String#valueOf(float)}.
 *
 * @param offset
 *            the index to insert at.
 * @param f
 *            the {@code float} value to insert.
 * @return this builder.
 * @throws StringIndexOutOfBoundsException
 *             if {@code offset} is negative or greater than the current
 *             {@code length()}.
 * @see String#valueOf(float)
 */
public StringBuilder insert(int offset, float f) {
  insert0(offset, Float.toString(f));
  return this;
}

代码示例来源:origin: robovm/robovm

/**
 * Inserts the string representation of the specified {@code Object} at the
 * specified {@code offset}. The {@code Object} value is converted to a
 * String according to the rule defined by {@link String#valueOf(Object)}.
 *
 * @param offset
 *            the index to insert at.
 * @param obj
 *            the {@code Object} to insert.
 * @return this builder.
 * @throws StringIndexOutOfBoundsException
 *             if {@code offset} is negative or greater than the current
 *             {@code length()}.
 * @see String#valueOf(Object)
 */
public StringBuilder insert(int offset, Object obj) {
  insert0(offset, obj == null ? "null" : obj.toString());
  return this;
}

代码示例来源:origin: robovm/robovm

/**
 * Inserts the string representation of the specified {@code int} value at
 * the specified {@code offset}. The {@code int} value is converted to a
 * String according to the rule defined by {@link String#valueOf(int)}.
 *
 * @param offset
 *            the index to insert at.
 * @param i
 *            the {@code int} value to insert.
 * @return this builder.
 * @throws StringIndexOutOfBoundsException
 *             if {@code offset} is negative or greater than the current
 *             {@code length()}.
 * @see String#valueOf(int)
 */
public StringBuilder insert(int offset, int i) {
  insert0(offset, Integer.toString(i));
  return this;
}

代码示例来源:origin: robovm/robovm

/**
 * Inserts the string representation of the specified {@code double} value
 * at the specified {@code offset}. The {@code double} value is converted
 * to a String according to the rule defined by
 * {@link String#valueOf(double)}.
 *
 * @param offset
 *            the index to insert at.
 * @param d
 *            the {@code double} value to insert.
 * @return this builder.
 * @throws StringIndexOutOfBoundsException
 *             if {@code offset} is negative or greater than the current
 *             {@code length()}.
 * @see String#valueOf(double)
 */
public StringBuilder insert(int offset, double d) {
  insert0(offset, Double.toString(d));
  return this;
}

代码示例来源:origin: robovm/robovm

/**
 * Inserts the string representation of the specified {@code long} value at
 * the specified {@code offset}. The {@code long} value is converted to a
 * String according to the rule defined by {@link String#valueOf(long)}.
 *
 * @param offset
 *            the index to insert at.
 * @param l
 *            the {@code long} value to insert.
 * @return this builder.
 * @throws StringIndexOutOfBoundsException
 *             if {@code offset} is negative or greater than the current
 *             {code length()}.
 * @see String#valueOf(long)
 */
public StringBuilder insert(int offset, long l) {
  insert0(offset, Long.toString(l));
  return this;
}

代码示例来源:origin: robovm/robovm

/**
 * Inserts the string representation of the specified {@code CharSequence}
 * at the specified {@code offset}. The {@code CharSequence} is converted
 * to a String as defined by {@link CharSequence#toString()}. If {@code s}
 * is {@code null}, then the String {@code "null"} is inserted.
 *
 * @param offset
 *            the index to insert at.
 * @param s
 *            the {@code CharSequence} to insert.
 * @return this builder.
 * @throws IndexOutOfBoundsException
 *             if {@code offset} is negative or greater than the current
 *             {@code length()}.
 * @see CharSequence#toString()
 */
public StringBuilder insert(int offset, CharSequence s) {
  insert0(offset, s == null ? "null" : s.toString());
  return this;
}

代码示例来源:origin: MobiVM/robovm

/**
 * Inserts the specified string at the specified {@code offset}. If the
 * specified string is null, then the String {@code "null"} is inserted.
 *
 * @param offset
 *            the index to insert at.
 * @param str
 *            the {@code String} to insert.
 * @return this builder.
 * @throws StringIndexOutOfBoundsException
 *             if {@code offset} is negative or greater than the current
 *             {@code length()}.
 */
public StringBuilder insert(int offset, String str) {
  insert0(offset, str);
  return this;
}

代码示例来源:origin: ibinti/bugvm

/**
 * Inserts the specified string at the specified {@code offset}. If the
 * specified string is null, then the String {@code "null"} is inserted.
 *
 * @param offset
 *            the index to insert at.
 * @param str
 *            the {@code String} to insert.
 * @return this builder.
 * @throws StringIndexOutOfBoundsException
 *             if {@code offset} is negative or greater than the current
 *             {@code length()}.
 */
public StringBuilder insert(int offset, String str) {
  insert0(offset, str);
  return this;
}

代码示例来源:origin: MobiVM/robovm

/**
 * Inserts the string representation of the specified {@code char} value at
 * the specified {@code offset}. The {@code char} value is converted to a
 * string according to the rule defined by {@link String#valueOf(char)}.
 *
 * @param offset
 *            the index to insert at.
 * @param c
 *            the {@code char} value to insert.
 * @return this builder.
 * @throws IndexOutOfBoundsException
 *             if {@code offset} is negative or greater than the current
 *             {@code length()}.
 * @see String#valueOf(char)
 */
public StringBuilder insert(int offset, char c) {
  insert0(offset, c);
  return this;
}

代码示例来源:origin: ibinti/bugvm

/**
 * Inserts the string representation of the specified {@code Object} at the
 * specified {@code offset}. The {@code Object} value is converted to a
 * String according to the rule defined by {@link String#valueOf(Object)}.
 *
 * @param offset
 *            the index to insert at.
 * @param obj
 *            the {@code Object} to insert.
 * @return this builder.
 * @throws StringIndexOutOfBoundsException
 *             if {@code offset} is negative or greater than the current
 *             {@code length()}.
 * @see String#valueOf(Object)
 */
public StringBuilder insert(int offset, Object obj) {
  insert0(offset, obj == null ? "null" : obj.toString());
  return this;
}

代码示例来源:origin: MobiVM/robovm

/**
 * Inserts the string representation of the specified {@code double} value
 * at the specified {@code offset}. The {@code double} value is converted
 * to a String according to the rule defined by
 * {@link String#valueOf(double)}.
 *
 * @param offset
 *            the index to insert at.
 * @param d
 *            the {@code double} value to insert.
 * @return this builder.
 * @throws StringIndexOutOfBoundsException
 *             if {@code offset} is negative or greater than the current
 *             {@code length()}.
 * @see String#valueOf(double)
 */
public StringBuilder insert(int offset, double d) {
  insert0(offset, Double.toString(d));
  return this;
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Inserts the string representation of the specified {@code float} value at
 * the specified {@code offset}. The {@code float} value is converted to a
 * string according to the rule defined by {@link String#valueOf(float)}.
 *
 * @param offset
 *            the index to insert at.
 * @param f
 *            the {@code float} value to insert.
 * @return this builder.
 * @throws StringIndexOutOfBoundsException
 *             if {@code offset} is negative or greater than the current
 *             {@code length()}.
 * @see String#valueOf(float)
 */
public StringBuilder insert(int offset, float f) {
  insert0(offset, Float.toString(f));
  return this;
}

代码示例来源:origin: ibinti/bugvm

/**
 * Inserts the string representation of the specified {@code CharSequence}
 * at the specified {@code offset}. The {@code CharSequence} is converted
 * to a String as defined by {@link CharSequence#toString()}. If {@code s}
 * is {@code null}, then the String {@code "null"} is inserted.
 *
 * @param offset
 *            the index to insert at.
 * @param s
 *            the {@code CharSequence} to insert.
 * @return this builder.
 * @throws IndexOutOfBoundsException
 *             if {@code offset} is negative or greater than the current
 *             {@code length()}.
 * @see CharSequence#toString()
 */
public StringBuilder insert(int offset, CharSequence s) {
  insert0(offset, s == null ? "null" : s.toString());
  return this;
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Inserts the string representation of the specified {@code CharSequence}
 * at the specified {@code offset}. The {@code CharSequence} is converted
 * to a String as defined by {@link CharSequence#toString()}. If {@code s}
 * is {@code null}, then the String {@code "null"} is inserted.
 *
 * @param offset
 *            the index to insert at.
 * @param s
 *            the {@code CharSequence} to insert.
 * @return this builder.
 * @throws IndexOutOfBoundsException
 *             if {@code offset} is negative or greater than the current
 *             {@code length()}.
 * @see CharSequence#toString()
 */
public StringBuilder insert(int offset, CharSequence s) {
  insert0(offset, s == null ? "null" : s.toString());
  return this;
}

相关文章