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

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

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

StringBuilder.subSequence介绍

暂无

代码示例

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

@Override
public CharSequence subSequence(int start, int end) {
  return sb.subSequence(start, end);
}

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

private CharSequence currentLine() {
 // Optimize subsequence if necessary
 return builder.subSequence(lineStartIndex, builder.length());
}

代码示例来源:origin: apache/hive

private String getMemoizedSubString(int start, int end) {
 return  (astStr == null || start < 0 || end > astStr.length() || start >= end) ? null :
  astStr.subSequence(start, end).toString();
}

代码示例来源:origin: apache/drill

private String getMemoizedSubString(int start, int end) {
 return  (astStr == null || start < 0 || end > astStr.length() || start >= end) ? null :
  astStr.subSequence(start, end).toString();
}

代码示例来源:origin: com.sun.xml.bind/jaxb-impl

public CharSequence subSequence(int start, int end) {
  return getLiteral().subSequence(start,end);
}

代码示例来源:origin: oblac/jodd

@Override
protected void endType() {
  super.endType();
  String type = declaration.subSequence(declarationTypeOffset, declaration.length()).toString();
  maybeUseType(type);
}

代码示例来源:origin: pentaho/pentaho-kettle

endNanosecondsPosition =
 ( endNanosecondsPosition >= dateText.length() ) ? dateText.length() : endNanosecondsPosition;
String nanoseconds = String.valueOf( dateText.subSequence( startNanosecondsPosition, endNanosecondsPosition ) );
dateText.delete( startNanosecondsPosition, endNanosecondsPosition );
ParsePosition position = new ParsePosition( 0 );

代码示例来源:origin: konsoletyper/teavm

replacementParts.add(res.subSequence(replacementPos, res.length()));
        replacementPos = res.length();
replacementParts.add(res.subSequence(replacementPos, res.length()));

代码示例来源:origin: apache/nifi

if (sb.length() > 2 && sb.subSequence(sb.length() - 2, sb.length()).equals(", ")) {
  sb.delete(sb.length() - 2, sb.length());

代码示例来源:origin: apache/drill

String jodaToken = postgresToJodaMap.get(firstMatch);
if (StringUtils.countMatches(builder.subSequence(0, minPos), JODA_ESCAPE_CHARACTER) % 2 == 0) {
 int offset = minPos + firstMatch.getName().length();
 builder.replace(minPos, offset, jodaToken);

代码示例来源:origin: cincheo/jsweet

private static boolean testStringAt(StringBuilder sb, int i, String string) {
  if (i < 0) {
    return false;
  } else if (i + string.length() > sb.length()) {
    return false;
  } else {
    return sb.subSequence(i, i + string.length()).equals(string);
  }
}

代码示例来源:origin: org.glassfish.jaxb/jaxb-runtime

public CharSequence subSequence(int start, int end) {
  return getLiteral().subSequence(start,end);
}

代码示例来源:origin: optimaize/language-detector

@Override
public CharSequence subSequence(int start, int end) {
  return stringBuilder.subSequence(start, end);
}

代码示例来源:origin: owlcs/owlapi

@Override
public CharSequence subSequence(int start, int end) {
  StringBuilder sb = new StringBuilder(namespace);
  sb.append(remainder);
  return sb.subSequence(start, end);
}

代码示例来源:origin: net.sourceforge.owlapi/owlapi-distribution

@Override
public CharSequence subSequence(int start, int end) {
  StringBuilder sb = new StringBuilder(namespace);
  sb.append(remainder);
  return sb.subSequence(start, end);
}

代码示例来源:origin: org.jboss.arquillian/arquillian-impl-base

private <T> String toClassString(Collection<Class<? extends T>> providers)
{
 StringBuilder sb = new StringBuilder();
 for(Class<?> provider : providers)
 {
   sb.append(provider.getName()).append(", ");
 }
 return sb.subSequence(0, sb.length()-2).toString();
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-content

private void checkAndCorrectIfLastIsNotCharacter(StringBuilder sb) {
  if(sb.length()==0)return;
  CharSequence test = sb.subSequence(sb.length()-1,sb.length());
  Matcher matcher = Pattern.compile("[,]",Pattern.CASE_INSENSITIVE).matcher(test);
  if(matcher.find()) sb.deleteCharAt(sb.length()-1);
}

代码示例来源:origin: com.ociweb/pronghorn-pipes

@Override
public CharSequence subSequence(int start, int end) {
  if (!isInit) {
    PipeReader.readUTF8(pipe, loc, target);
    isInit = true;
  }
  return target.subSequence(start, end);
}

代码示例来源:origin: google/closure-stylesheets

/** Deletes the end of the buffer if it exactly equals {@code s}. */
public void deleteEndingIfEndingIs(String s) {
 if (sb.subSequence(sb.length() - s.length(), sb.length()).equals(s)) {
  deleteLastChars(s.length());
 }
}

代码示例来源:origin: org.cogroo.lang.pt_br/cogroo-addon-pt_br

private static String convert(Map<String, String> data) {
  StringBuilder sb = new StringBuilder();
  for (String key : data.keySet()) {
    sb.append(encode(key) + "=" + encode(data.get(key)));
    sb.append("&");
  }
  return sb.subSequence(0, sb.length() - 1).toString();
}

相关文章