Tabnine Logo
StringBuilder.delete
Code IndexAdd Tabnine to your IDE (free)

How to use
delete
method
in
java.lang.StringBuilder

Best Java code snippets using java.lang.StringBuilder.delete (Showing top 20 results out of 15,732)

origin: spring-projects/spring-framework

  private void clear(StringBuilder sb) {
    sb.delete(0, sb.length());
  }
}
origin: skylot/jadx

private void removeFirstEmptyLine() {
  int len = NL.length();
  if (buf.substring(0, len).equals(NL)) {
    buf.delete(0, len);
  }
}
origin: libgdx/libgdx

private void flushBuilder() {
  if (mBuilder.length() > 0) {
    Log.v("GLSurfaceView", mBuilder.toString());
    mBuilder.delete(0, mBuilder.length());
  }
}
origin: libgdx/libgdx

private void flushBuilder() {
  if (mBuilder.length() > 0) {
    Log.v("GLSurfaceView", mBuilder.toString());
    mBuilder.delete(0, mBuilder.length());
  }
}
origin: lets-blade/blade

private static StringBuilder clearLastComma(StringBuilder buff) {
  int lastComma = buff.lastIndexOf(", ");
  // No comma found, take everything
  if (-1 != lastComma)
    buff.delete(lastComma, buff.length());
  return buff;
}
origin: lets-blade/blade

private static StringBuilder clearLastComma(StringBuilder buff) {
  int lastComma = buff.lastIndexOf(", ");
  // No comma found, take everything
  if (-1 != lastComma)
    buff.delete(lastComma, buff.length());
  return buff;
}
origin: square/okhttp

private String headerValue() {
 StringBuilder result = new StringBuilder();
 if (noCache) result.append("no-cache, ");
 if (noStore) result.append("no-store, ");
 if (maxAgeSeconds != -1) result.append("max-age=").append(maxAgeSeconds).append(", ");
 if (sMaxAgeSeconds != -1) result.append("s-maxage=").append(sMaxAgeSeconds).append(", ");
 if (isPrivate) result.append("private, ");
 if (isPublic) result.append("public, ");
 if (mustRevalidate) result.append("must-revalidate, ");
 if (maxStaleSeconds != -1) result.append("max-stale=").append(maxStaleSeconds).append(", ");
 if (minFreshSeconds != -1) result.append("min-fresh=").append(minFreshSeconds).append(", ");
 if (onlyIfCached) result.append("only-if-cached, ");
 if (noTransform) result.append("no-transform, ");
 if (immutable) result.append("immutable, ");
 if (result.length() == 0) return "";
 result.delete(result.length() - 2, result.length());
 return result.toString();
}
origin: lets-blade/blade

private static String takeUntilDotOrEnd(StringBuilder buff) {
  final int firstPointIdx = buff.indexOf(".");
  String    result;
  if (-1 == firstPointIdx) {
    result = buff.toString();
    buff.setLength(0);
  } else {
    result = buff.substring(0, firstPointIdx);
    buff.delete(0, firstPointIdx + 1);
  }
  return result;
}
origin: lets-blade/blade

private static String takeUntilDotOrEnd(StringBuilder buff) {
  final int firstPointIdx = buff.indexOf(".");
  String    result;
  if (-1 == firstPointIdx) {
    result = buff.toString();
    buff.setLength(0);
  } else {
    result = buff.substring(0, firstPointIdx);
    buff.delete(0, firstPointIdx + 1);
  }
  return result;
}
origin: bumptech/glide

@Override
public String toString() {
 StringBuilder sb = new StringBuilder("GroupedLinkedMap( ");
 LinkedEntry<K, V> current = head.next;
 boolean hadAtLeastOneItem = false;
 while (!current.equals(head)) {
  hadAtLeastOneItem = true;
  sb.append('{').append(current.key).append(':').append(current.size()).append("}, ");
  current = current.next;
 }
 if (hadAtLeastOneItem) {
  sb.delete(sb.length() - 2, sb.length());
 }
 return sb.append(" )").toString();
}
origin: pockethub/PocketHub

private static StringBuilder strip(final StringBuilder input,
                  final String prefix, final String suffix) {
  int start = input.indexOf(prefix);
  while (start != -1) {
    int end = input.indexOf(suffix, start + prefix.length());
    if (end == -1) {
      end = input.length();
    }
    input.delete(start, end + suffix.length());
    start = input.indexOf(prefix, start);
  }
  return input;
}
origin: spring-projects/spring-framework

/**
 * Append the query string of the current request to the target redirect URL.
 * @param targetUrl the StringBuilder to append the properties to
 * @param request the current request
 * @since 4.1
 */
protected void appendCurrentQueryParams(StringBuilder targetUrl, HttpServletRequest request) {
  String query = request.getQueryString();
  if (StringUtils.hasText(query)) {
    // Extract anchor fragment, if any.
    String fragment = null;
    int anchorIndex = targetUrl.indexOf("#");
    if (anchorIndex > -1) {
      fragment = targetUrl.substring(anchorIndex);
      targetUrl.delete(anchorIndex, targetUrl.length());
    }
    if (targetUrl.toString().indexOf('?') < 0) {
      targetUrl.append('?').append(query);
    }
    else {
      targetUrl.append('&').append(query);
    }
    // Append anchor fragment, if any, to end of URL.
    if (fragment != null) {
      targetUrl.append(fragment);
    }
  }
}
origin: spring-projects/spring-framework

String key = sb.substring(keyStart + PropertyAccessor.PROPERTY_KEY_PREFIX.length(), keyEnd);
if ((key.startsWith("'") && key.endsWith("'")) || (key.startsWith("\"") && key.endsWith("\""))) {
  sb.delete(keyStart + 1, keyStart + 2);
  sb.delete(keyEnd - 2, keyEnd - 1);
  keyEnd = keyEnd - 2;
origin: graphql-java/graphql-java

private String joinReasons(List<Conflict> conflicts) {
  StringBuilder result = new StringBuilder();
  result.append("(");
  for (Conflict conflict : conflicts) {
    result.append(conflict.reason);
    result.append(", ");
  }
  result.delete(result.length() - 2, result.length());
  result.append(")");
  return result.toString();
}
origin: apache/storm

  private void logDataPoints(Collection<DataPoint> dataPoints, StringBuilder sb, String header) {
    for (DataPoint p : dataPoints) {
      sb.delete(header.length(), sb.length());
      sb.append(p.getName())
       .append(padding).delete(header.length() + 23, sb.length()).append("\t")
       .append(p.getValue());
      LOG.info(sb.toString());
    }
  }
}
origin: prestodb/presto

private String headerValue() {
 StringBuilder result = new StringBuilder();
 if (noCache) result.append("no-cache, ");
 if (noStore) result.append("no-store, ");
 if (maxAgeSeconds != -1) result.append("max-age=").append(maxAgeSeconds).append(", ");
 if (sMaxAgeSeconds != -1) result.append("s-maxage=").append(sMaxAgeSeconds).append(", ");
 if (isPrivate) result.append("private, ");
 if (isPublic) result.append("public, ");
 if (mustRevalidate) result.append("must-revalidate, ");
 if (maxStaleSeconds != -1) result.append("max-stale=").append(maxStaleSeconds).append(", ");
 if (minFreshSeconds != -1) result.append("min-fresh=").append(minFreshSeconds).append(", ");
 if (onlyIfCached) result.append("only-if-cached, ");
 if (noTransform) result.append("no-transform, ");
 if (immutable) result.append("immutable, ");
 if (result.length() == 0) return "";
 result.delete(result.length() - 2, result.length());
 return result.toString();
}
origin: Tencent/tinker

private static String subNodeToString(Node node) {
  StringBuilder stringBuilder = new StringBuilder();
  if (node != null) {
    NodeList nodeList = node.getChildNodes();
    stringBuilder.append(nodeToString(node, false));
    stringBuilder.append(StringUtil.CRLF_STRING);
    int nodeListLength = nodeList.getLength();
    for (int i = 0; i < nodeListLength; i++) {
      Node childNode = nodeList.item(i);
      if (childNode.getNodeType() != Node.ELEMENT_NODE) {
        continue;
      }
      stringBuilder.append(nodeToString(childNode, true));
      stringBuilder.append(StringUtil.CRLF_STRING);
    }
    if (stringBuilder.length() > StringUtil.CRLF_STRING.length()) {
      stringBuilder.delete(stringBuilder.length() - StringUtil.CRLF_STRING.length(), stringBuilder.length());
    }
  }
  return stringBuilder.toString();
}
origin: skylot/jadx

  public String test() {
    // a chain we can't simplify
    return new StringBuilder("[init]").append("a1").delete(1, 2).toString();
  }
}
origin: neo4j/neo4j

@Override
public void clear()
{
  builder.delete( 0, builder.length() );
  field = 0;
}
origin: libgdx/libgdx

  @Override
  protected void render (ModelBatch batch, Array<ModelInstance> instances) {
    if(emitters.size > 0){
      //Update
      float delta = Gdx.graphics.getDeltaTime();
      builder.delete(0, builder.length());
      builder.append(Gdx.graphics.getFramesPerSecond());
      fpsLabel.setText(builder);
      ui.act(delta);

      billboardParticleBatch.begin();
      for (ParticleController controller : emitters){
        controller.update();
        controller.draw();
      }
      billboardParticleBatch.end();
      batch.render(billboardParticleBatch, environment);
    }
    batch.render(instances, environment);
    ui.draw();
  }
}
java.langStringBuilderdelete

Javadoc

Deletes a sequence of characters specified by start and end. Shifts any remaining characters to the left.

Popular methods of StringBuilder

  • append
  • toString
  • <init>
    Constructs a string builder initialized to the contents of the specified string. The initial capacit
  • length
  • setLength
  • charAt
  • deleteCharAt
  • insert
  • substring
  • replace
  • setCharAt
  • indexOf
  • setCharAt,
  • indexOf,
  • lastIndexOf,
  • reverse,
  • appendCodePoint,
  • getChars,
  • subSequence,
  • ensureCapacity,
  • trimToSize

Popular in Java

  • Making http post requests using okhttp
  • getApplicationContext (Context)
  • scheduleAtFixedRate (Timer)
  • notifyDataSetChanged (ArrayAdapter)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Top plugins for WebStorm
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